Closed riamon-v closed 4 years ago
Hi @riamon-v Thanks for the report, I will check ASAP I'm surprise the app crashes, do you see any logs on adb logcat ?
I got an error like this on my phone, and my own app, I assume it is the same for the example cause it crashes the exact same time @Dallas62
This error is strange, but it seems that Firebase is not initialized
This error is strange, but it seems that Firebase is not initialized
Well.. not getting this error in 3.1.9 in my own app, and the example app crashed when trying to configure, so i'm kinda stuck here
This could be due to https://github.com/zo0r/react-native-push-notification/pull/1355/ I will look if we can do something for this in the library; Do you need other services from firebase ?
Take a look at this: https://stackoverflow.com/questions/40081539/default-firebaseapp-is-not-initialized
This could be due to #1355 I will look if we can do something for this in the library; Do you need other services from firebase ?
Take a look at this: https://stackoverflow.com/questions/40081539/default-firebaseapp-is-not-initialized
Oh ok I see, have you succeeded to reproduce the bug on the example app ? I don't need any other services from firebase for now, only the cloud messaging part
Actually I don't have time to look at this, I will come back when I looked into it. If you want to solve this issue, you can try to install Firebase in Android (until the initialisation part).
Same problem here. When I remove the param senderID dont crash, but will work only local. here is my build.gradle implementations
implementation 'com.google.firebase:firebase-core:9.6.1' implementation ('com.google.android.gms:play-services-gcm:11.6.2') { force = true; } implementation 'com.google.android.gms:play-services-ads:19.1.0'
the AndroidManifest
`
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationRegistrationService"/>
<service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService" android:exported="false">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>`
Same problem here. When I remove the param senderID dont crash, but will work only local. here is my build.gradle implementations
implementation 'com.google.firebase:firebase-core:9.6.1' implementation ('com.google.android.gms:play-services-gcm:11.6.2') { force = true; } implementation 'com.google.android.gms:play-services-ads:19.1.0'
the AndroidManifest
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" /> <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" /> <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver> <service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationRegistrationService"/> <service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService" android:exported="false"> <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> </intent-filter> </service>
it seems your config is not up to date as mention here https://github.com/zo0r/react-native-push-notification/issues/1380#issuecomment-618357492
Same problem here. When I remove the param senderID dont crash, but will work only local. here is my build.gradle implementations
implementation 'com.google.firebase:firebase-core:9.6.1' implementation ('com.google.android.gms:play-services-gcm:11.6.2') { force = true; } implementation 'com.google.android.gms:play-services-ads:19.1.0'
the AndroidManifest<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <permission android:name="${applicationId}.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" /> <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" /> <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> </intent-filter> </receiver> <service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationRegistrationService"/> <service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService" android:exported="false"> <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> </intent-filter> </service>
it seems your config is not up to date as mention here #1380 (comment)
Hi, i have solved the problem with the
This could be due to #1355 I will look if we can do something for this in the library; Do you need other services from firebase ?
Take a look at this: https://stackoverflow.com/questions/40081539/default-firebaseapp-is-not-initialized
my bundle.gradle in root
dependencies {
classpath("com.android.tools.build:gradle:3.4.2")
classpath 'com.google.gms:google-services:4.3.3'
}
my bundle.gradle in module level:
apply plugin: 'com.google.gms.google-services' //on top
dependencies {
implementation 'com.google.firebase:firebase-core:9.6.1'//maybe its not necessary?
implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation ('com.google.android.gms:play-services-gcm:17.0.0') { force = true; }
implementation 'com.google.android.gms:play-services-ads:19.1.0'
}
it solved for me
Cool ! If something is missing on the README feel free to update ;) I will check tomorrow
I just complete the README, you can check it, if it's not clear a PR is welcome 😉
@dhoncrisley Did not fix the issue for me. I now have something like:
> Task :app:processDebugGoogleServices FAILED
36 actionable tasks: 3 executed, 33 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
/Users/piman/Work/mobile-react-native/android/app/src/nullnull/google-services.json
/Users/piman/Work/mobile-react-native/android/app/src/debug/google-services.json
/Users/piman/Work/mobile-react-native/android/app/src/nullnullDebug/google-services.json
/Users/piman/Work/mobile-react-native/android/app/src/nullnull/debug/google-services.json
/Users/piman/Work/mobile-react-native/android/app/src/debug/nullnull/google-services.json
/Users/piman/Work/mobile-react-native/android/app/google-services.json
Hi @riamon-v File google-services.json is missing. The Google Services Plugin cannot function without it.
Hi @riamon-v File google-services.json is missing. The Google Services Plugin cannot function without it.
Yeah sorry, I just figured this out
Bug
Hello. I was struggling configure the pushNotification plugin in my own application so I decided to check if it was working on the example app
Onde I launched it I tried localNotifications, working fine. However I wanted to try a remote notification (what i want to do in my own app as well) and filled in the input to configure my FCM senderID. Seems the app crash at this step when I click the button. I investigated a bit and it seems to come from the onRegister function but I can't find what cause the problem exactly. I recently updated the package from 3.1.9 to 3.2.1 and since then it doesn't work anymore. The steps to configure the PushNotifications plugins were working fine in 3.1.9, I could register and receiver notifications as expected
Any idea ?
Environment info
react-native info
output:Library version: 3.2.1
Steps To Reproduce
Describe what you expected to happen:
Reproducible sample code