8

I want to send info about user non-fatal exceptions through recordException() method, but default crashlytics implementation sends them only after app is restarted (which is quite a strange behaviour o_O)

I tried to disable automatic reports collection through setCrashlyticsCollectionEnabled(false) method and send them manually through sendUnsentReports(), but, alas, firebase continues to send them only after the app is restarted.

Has anybody solved that kind of a problem and how?

blinker
  • 599
  • 5
  • 18
  • I have the same issue. I have an app in kiosk mode, so it never restarts, and non fatal errors are never sent ... – Jeremie Dec 02 '20 at 15:56
  • 1
    @Jeremie we eventually switched to Sentry, it sends non-fatal exсeptions quite fast ~1 minute or even faster – blinker Mar 10 '21 at 11:34

1 Answers1

11

Yes, that’s expected. Logged exceptions are not sent immediately when they are recorded, otherwise there would be pull requests at random intervals which would use up a lot of bandwidth and battery.

They are batched and sent either on startup or at crash time, and when you call sendUnsentReports, all cached reports are sent at that time, but it doesn’t send anything from the current session.

Oleg Kodysh
  • 986
  • 6
  • 13
  • 4
    "... but it doesn’t send anything from the current session" is the key sentence here. Would it be so hard for Google to add this is a comment to the `sendUnsentReports()` function? Soooo much wasted time trying to figure out why stuff isn't working. Anyway, I appreciate the clarification here though... thanks. – Craig Edwards Mar 27 '21 at 20:15
  • 2
    "... but it doesn’t send anything from the current session", also makes Crashlytics and Flutter be a utterly useless combination, if you have an enterprise app that is not meant to restart, ever. – DarkNeuron Jun 08 '21 at 11:43
  • 1
    Crashlytics itself has a method to send bugs immediately (of course). I made ask Firebase team to give an ability to use this method. You can participate here: https://github.com/FirebaseExtended/flutterfire/discussions/6660 – Rodion Mostovoi Jul 19 '21 at 22:56