sarriaroman / FabricPlugin

Fabric.io plugin for Cordova or Phonegap
MIT License
198 stars 159 forks source link

App-restart required for errors to show up #58

Closed FabianAlbrecht closed 6 years ago

FabianAlbrecht commented 7 years ago

I'm using this plugin with my Ionic app on an Android device and I log errors with window.fabric.Crashlytics.sendNonFatalCrash("ERROR");

But the errors are only visible in the Fabric UI after killing the app and restarting it. Does anybody have a solution for this?

ranvirgorai commented 7 years ago

In your App where u putting this snippet "window.fabric.Crashlytics.sendNonFatalCrash("ERROR");"

Can you share your complete code of that file.

FabianAlbrecht commented 7 years ago

Hi, here is the code:

app.module.js.zip

B-Stewart commented 7 years ago

I'm experiencing the same thing. My guess is that it is because when you use sendCrash() the app is killed and the logs are sent but the nonfatal doesn't kill the app. I'm not sure what the intended behavior is. What is interesting is that it looks the the timestamp is actually created when the code runs, not when the actual nonfatal is sent.

.run(function($ionicPlatform, $translate, $cordovaSQLite, $ionicConfig, $cordovaPushV5, $rootScope, AzureService, $window) {
  $ionicPlatform.ready(function() {
$window.fabric.Crashlytics.sendNonFatalCrash("Azure Service Error Non Fatal");
//...
FabianAlbrecht commented 7 years ago

Just found an interesting sentence in the fabric docs (Cause a Test Crash):

Crashes are processed in real-time after you relaunch the app post-crash; make sure you’ve relaunched your app and that it launches fully in the foreground.

So it seems to be expected behavior of the official fabric plugin.