I was trying to add push notification on react-native app, so I used react-native-push-notification. The library configuration went well, but when receiving notification the APP crashes immediately saying "FirebaseApp is not initialized".
Crash report AndroidRuntime: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this com.myapp. Make sure to call FirebaseApp.initializeApp(Context) first.
How do I initialize the FirebaseApp or fix this problem? Any help will be greatly appreciated.
For more information there is an opened Github issue https://github.com/zo0r/react-native-push-notification/issues/852
OK! it works now.
build.gradle
buildscript {
dependencies {
classpath 'com.google.gms:google-services:+'
}
}
app/build.gradle
// At the very bottom of the file
apply plugin: 'com.google.gms.google-services'
Credit https://github.com/zo0r/react-native-push-notification/issues/852#issuecomment-417641675
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With