ReallySmallSoftware / cordova-plugin-firebase-crashlytics

Google Firebase Crashlytics Cordova plugin
Other
33 stars 80 forks source link

Not able to use firebase crashlytics plugin? #17

Closed ios-dev-newbie closed 4 years ago

ios-dev-newbie commented 5 years ago

Expected Behavior

Crashlytics plugin need to be able to add in project and able to use the events provided by plugin.

Actual Behavior

Able to add the plugin in app but when I tried to use it I got an error on below lines var crashlytics = FirebaseCrashlytics.initialise(); "Property 'initialise' does not exist on type 'typeof FirebaseCrashlytics'.ts(2339) " I have also follow the tutorial over here: https://ionicframework.com/docs/native/firebase-crashlytics

Steps to Reproduce the Problem

Just install the plugin with below command: cordova plugin add cordova-plugin-firebase-crashlytics --variable ANDROID_FIREBASE_CORE_VERSION=16.0.0 --save

And try to use it in project

Specifications

Ionic: ionic (Ionic CLI) : 4.12.0 (/usr/local/lib/node_modules/ionic) Ionic Framework : @ionic/angular 4.1.2 @angular-devkit/build-angular : 0.13.7 @angular-devkit/schematics : 7.2.4 @angular/cli : 7.3.7 @ionic/angular-toolkit : 1.4.1

Cordova:

cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1) Cordova Platforms : android 7.1.4, ios 4.5.5

System:

Android SDK Tools : 26.1.1 ios-deploy : 1.9.4 NodeJS : v10.8.0 npm : 6.4.1 OS : macOS Mojave Xcode : Xcode 10.1 Build version 10B61

Sahiltuteja commented 5 years ago

Have you get any update on this. Same issue i am facing too.

pdelaby commented 5 years ago

You need to install the npm module, as described in https://ionicframework.com/docs/native/firebase-crashlytics : npm install @ionic-native/firebase-crashlytics.

Once that's done, you can use FirebaseCrashlytics in your code :


import { FirebaseCrashlytics, FirebaseCrashlyticsOriginal } from '@ionic-native/firebase-crashlytics';
... 
export class MyComponenent {
   crashlyticsStuffs(){
    var crashlytics:FirebaseCrashlyticsOriginal = FirebaseCrashlytics.initialise();
    // log exception to test 
    crashlytics.logException("my caught exception");
    // crash to test
    crashlytics.crash();
  }
}
ReallySmallSoftware commented 4 years ago

Sorry I am unable to provide ionic support. I am assuming the above fixes the problem.

mattid89 commented 4 years ago

Hello @ReallySmallSoftware !! Why can't you provide ionic support if in fact the framework suggests you as the solution to consume the crashlytics api? Anyway, thanks for your contributions!