Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How I can integrate this plugin into my ionic 3 app? #131

Open
lsantaniello opened this issue Apr 10, 2018 · 3 comments
Open

How I can integrate this plugin into my ionic 3 app? #131

lsantaniello opened this issue Apr 10, 2018 · 3 comments

Comments

@lsantaniello
Copy link

Hi all,
I'd like to integrate this plugin into my ionic 3 app but I have some problems.

I installed plugin using the following command:
cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=XXX --variable FABRIC_API_SECRET=xxx

Then I tryed to insert the code into my app:
window.fabric.Crashlytics.addLog("about to send a crash for testing!"); window.fabric.Crashlytics.sendCrash();

but I have "fabric doesn't exist" compilation error.

I replaced with:
(<any>window).fabric.Crashlytics.addLog("about to send a crash for testing!"); (<any>window).fabric.Crashlytics.sendCrash();

Then, I built my app and I generated the apk. I tested into my android simulator and when I execute the code, the app crash.

I have two questions:

  1. I don't know if my implementation is correct.
  2. How I can see the logs? When I log in into my fabric account, I don't see the log.

Thanks in advance
Luca

@o-dlr-o
Copy link

o-dlr-o commented Apr 30, 2018

Did you try
let fabric;
....
fabric.Crashlytics.addLog("about to send a crash for testing!");

And don't forget to include typings in your tsconfig.json :

"files": [ "plugins/cordova-fabric-plugin/typings/cordova-fabric-plugin.d.ts" ]

@lourensdev
Copy link

lourensdev commented Oct 16, 2018

@lsantaniello if you are using Ionic 3 you should follow these installation instructions: https://ionicframework.com/docs/native/crashlytics/

Crashlytics should be imported on the .ts file, and defined in your constructor for it to be usable. Also don't forget to add Crashlytics as a Provider in your app.module.ts file

@chethangowda
Copy link

chethangowda commented Nov 14, 2018

Am am not able to install fabric plugin in ionic 3 project,
used:
cordova plugin add cordova-fabric-plugin --variable FABRIC_API_KEY=XXX --variable FABRIC_API_SECRET=xxx

getting error:
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] postinstall:opencollective postinstall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\CKG\AppData\Roaming\npm-cache_logs\2018-11-14T08_59_13_062Z-debug.log`

@lsantaniello
can any one help to use fabric acrashlytics in ionic 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants