I am using FirebaseCrashlytics to log exception manually with FirebaseCrashlytics.getInstance().recordException(e)
but as a request from my PO, I need this exception to be uploaded immediately after this line. Is this possible?
On the docs, I've found the method sendUnsentReports()
but this doesn't look to work, I also checked right after record an exception if there is any unsent report using checkForUnsentReports()
but the result of the task is true only if I close and reopen the app.
Asked
Active
Viewed 1,136 times
2

robsonbbs
- 23
- 4
-
https://stackoverflow.com/questions/62409353/firebase-sendunsentreports-sends-exceptions-only-after-restart – Oleg Kodysh Oct 28 '20 at 19:15
-
@OlegKodysh Thanks this behavior makes too much sense! – robsonbbs Oct 28 '20 at 20:23
-
@OlegKodysh make this comment an answer and I will mark this answer as the right one. – robsonbbs Oct 29 '20 at 13:49
1 Answers
0
As linked here: firebase sendUnsentReports() sends exceptions only after restart
Logged exceptions are not sent immediately when they are recorded. They are batched and sent either on startup or at crash time. Calling sendUnsentReports, will cause cached reports to be sent at that time, but it will not send anything from the current session.

Oleg Kodysh
- 986
- 6
- 13