I want my react-native app to show a Firebase In-App Message on the first app launch after crash. Seems this is impossible at the moment? I'm using Firebase Crashlytics to track crashes.
Asked
Active
Viewed 133 times
1 Answers
0
I'm not 100% on the Firebase Messaging portion of it, but in terms of Crashlytics, you should be able to programmatically detect when there's been a crash and act if that condition is true (reference).
First, you could disable the default automatic crash collection:
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="false" />
Then, you could do something like this to detect if a crash happened:
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
...
if (crashlytics.didCrashOnPreviousExecution()) {
//send an in-app message: https://firebase.google.com/docs/in-app-messaging/explore-use-cases
}
if (crashlytics.checkForUnsentReports()) {
//will guarantee any unsent crash reports will be sent once this code block executes
crashlytics.sendUnsentReports();
}

Kevin Kokomani
- 1,568
- 7
- 14