Tomas Chalupnik
Tomas Chalupnik

Reputation: 115

Firebase - send notification to user when fatal crash is detected

I was looking throughout documentations of Firebase and I think that my use case is not accomplishable. But I will ask here anyway.

I have Android app using Firebase. Crashlytics and Firebase Cloud Messaging among others. I want to send push notification to user if he experiences fatal crash in my app. Something like "We are sorry, working on fix".

To identify user in Crashlytics I would use Crashlytics.setUserIdentifier(registrationToken) in MyFirebaseInstanceIdService (documented here https://firebase.google.com/docs/cloud-messaging/android/first-message). This will ensure, that I have token for sending message. Now I need to write trigger function (using Firebase functions) and send FCM message (trigger: https://firebase.google.com/docs/functions/crashlytics-events, API for FCM: https://firebase.google.com/docs/reference/admin/node/admin.messaging.Messaging).

Issue in this case is, that I cannot obtain userIdentifier in this callback because (according to this documentation: https://firebase.google.com/docs/reference/functions/functions.crashlytics.Issue), there is no such information.

Is there a way to solve this now? Or maybe in future? (Using only Firebase stuff)

Upvotes: 1

Views: 948

Answers (1)

Arnav Rao
Arnav Rao

Reputation: 7002

There should be some way or api to read crashlytics reports so that desired action can be automated utilizing the information in the crash report.

Upvotes: 0

Related Questions