-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SenderID is not set up correctly when initializing app #64
Comments
Same issue, had to revert to phonegap-plugin-push. |
"cordova-support-google-services": {} add this in cordova plugins in package.json.
|
I will be closing out this issue as unreproducible in the current release version 2.0.0 and based on ticket description and feedback, it appears the installation guide was skipped. This plugin does not include Adding Version 1.0.0 original goal was to support Cordova-Android 9.x out-of-the-box without additional configuration. But, to keep support for Cordova-Android 8.1+ users, there were additional setup steps that had to be performed. It was documented in the installation guide, which you should read here: https://github.com/havesource/cordova-plugin-push/blob/1.0.x/docs/INSTALLATION.md#cordova-android-8x-specifics Based on the original ticket description and other users' comments, it appears everyone was using plugin version 1.x and/or using Cordova-Android 8.1.0. It is recommended to upgrade both the platform and plugin to the latest release. The plugin version 1.x is no longer being maintained. Cordova-Android has just released 10.0.0 and there are additional releases in the pipeline. Lastly, as for the plugin, version 3.0.0 is in the making. |
Bug Report
When initializing Push Plugin through the JS call, following exception is thrown:
E/Push_Plugin: execute: Got Resources NotFoundException String resource ID #0x0
Seems related to this unfixed bug in the original repo:
phonegap#1800
The
google-services.json
is on its place and I tried to clean the app and build again too.From that issue seems it's conflict with InAppBrowser pluging, or rather the order these two plugins are installed, but I tried to reinstall cordova-plugin-push and uninstall InAppBrowser one, but the result is still same.
I found a difference between the two plugins in android/app/build.gradle file, which misses these lines after the update:
I found out a commit what is most likely breaking up the plugin:
#8
Therefore, for now I'm staying with the original plugin, which works just well.
Expected Behaviour
The app should be set for receiving FCM notifications. As part of this, SenderID should be saved into SharedPreferences.
Actual Behaviour
Init call will fire error event. The cause is value for gcm_defaultSenderId is not found. Therefore SendeID is not set and any incoming notification is not shown. I've moved from phonegap-push-plugin where I didn't have this problem.
Reproduce Scenario (including but not limited to)
Steps to Reproduce
Platform and Version
Android 9
(Android) Device Vendor
Sony Xperia XA2
cordova info
Printoutcordova-lib@9.0.1 with:
cordova-common@3.2.1
cordova-create@2.0.0
cordova-fetch@2.0.1
cordova-serve@3.0.0
Environment:
OS: win32
Node: v12.16.2
npm: 6.14.4
Plugins:
com.cordova.plugins.cookiemaster
cordova-install-referrer-api
cordova-plugin-dialogs
cordova-plugin-inappbrowser
cordova-plugin-whitelist
cordova-support-google-services
havesource-cordova-plugin-push
phonegap-plugin-multidex
EOF
package.json <<EOF
EOF
Sample Push Data Payload
Sample Code that illustrates the problem
Logs taken while reproducing problem
2020-11-18 20:58:38.930 23504-23622/cz.Menicka.restaurater V/Push_Plugin: execute: action=createChannel
2020-11-18 20:58:38.957 23504-23622/cz.Menicka.restaurater V/Push_Plugin: execute: action=init
2020-11-18 20:58:38.960 23504-23623/cz.Menicka.restaurater V/Push_Plugin: execute: data=[{"android":{"icon":"ic_notification","iconColor":"#EA654B","forceShow":true,"vibrate":true},"ios":{"alert":"true","badge":"true","sound":"true"}}]
2020-11-18 20:58:38.992 23504-23623/cz.Menicka.restaurater V/Push_Plugin: execute: jo={"icon":"ic_notification","iconColor":"#EA654B","forceShow":true,"vibrate":true}
2020-11-18 20:58:38.992 23504-23623/cz.Menicka.restaurater E/cka.restaurate: Invalid ID 0x00000000.
2020-11-18 20:58:38.992 23504-23623/cz.Menicka.restaurater E/Push_Plugin: execute: Got Resources NotFoundException String resource ID #0x0
The text was updated successfully, but these errors were encountered: