-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
changing targetSdkVersion to 31 make notification not fired #299
Comments
I am having a similar issue. Notifications only show up in the foreground. As a matter of fact, for me (running android 13 on samsung S21 FE 5G), if the app is in the background and a push arrives, the app crashes! Hopefully somebody can help with this... |
I've been running into the same issue, and I've identified the cause. Testing the receipt of push notifications using an emulator running the app, I see this fatal error:
Doing some further research, this may be caused by specifying an outdated version of the FCM library as part of the preferences when adding the plugin, but so far my attempts to update it have met with other errors. I'll continue to add information as I go. |
@thepsion5 @dimitriscsd @kotran88 |
We have exactly the same issue. Notifications work fine on older Android versions but causing the app to crash on Android 12, 13 (freescout-help-desk/freescout#2718) |
@thepsion5 Have you found the solution? This solution #293 (comment) does not work for us - still no push notifications on Android 13. |
The solution definitely works. After replacing the plugins, have you deleted your platforms and plugins folders and then built again? That needs to happen for the new plugin files to be placed in the platform. |
Android platform is removed and re-added. Still push notifications work on Android 9 phone but don't work on Android 13 (notifications are allowed for the app in the phone settings).
Excerpt from config.xml:
|
The commands above are not correct. You are removing the plugin, then re-adding the same one, instead of the fork. I am providing again the commands that will install the fork with the fix. Note that after "github.com" on the url, the username is different:
|
Thanks. Now we are getting the following error when doing
It comes from here https://github.com/marutifh/cordova-plugin-fcm-with-dependecy-updated/blob/master/src/android/FCMPlugin.gradle#L100 and thrown because in our
|
Not sure about that one. Depends on your setup. What I do know is, the configuration for this plugin (and most plugins for that matter) should now reside in package.json and not in config.xml Cordova switched away from putting that stuff in config.xml quite a while ago. I would remove that whole segment you have mentioned a few comments above from config.xml and I'd make sure my package.json looks ok. For reference, my package.json, in terms of this plugin looks like this:
That message about gradle might just be a warning. Is the build finishing or is it failing? |
Build is failing:
Can you please share your versions:
Here is what we have:
|
After updating nodejs, cordova-android and cordova to newer versions the build succeeded and push notifications are working now on Android 13. |
Hi bro would you explain how did you fix your issue? I tried this but it does not work |
on config.xml
<preference name="android-targetSdkVersion" value="31" />
I used it with value 30 and notificiation work find!
but changing it to 31, then rm android and add androoid@10, then it is not fired.
on package.json
ionic info
The text was updated successfully, but these errors were encountered: