-
Notifications
You must be signed in to change notification settings - Fork 288
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
Background push notifications on Android cannot be received (Android 12, targetSdkVersion 31, 4.0.0-dev.0 plugin version) #208
Comments
Hi I'm same problems. |
Hello ! You probably have an error in the console. |
@bluetech Do you have plans to upload the 4.0.0 version to NPM? |
In this comment you can read how to use the current solution: #185 (comment) |
Same issue here. Android 13, targetSdkVersion 32, 4.0.0-dev.0 plugin version |
I was able to fix it by using targetSdkVersion 32, 4.0.0-dev.0. However it caused a crash if my push body was send. by passing "icon": "ic_launcher" it did not crash and the push also showed in the background |
I encounter something similar that I want to share with you. Simply, a Message with a not null Notification object won't be notified via onMessageReceived(). In my case the solution was to change the structure of the message, putting title and body in the data object. https://firebase.google.com/docs/cloud-messaging/android/receive?hl=en#handling_messages Hope it helps other with the same (non)issue. |
hello! Thanks! |
Until the beginning of March I was using the @dev version and yesterday when I went to perform a build this error occurred annotation.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1. |
We had the same error here. |
To fix it i did exactly what you see in my attachment: You need to open the build.gradle file inside the platforms/android and change the classpath org.jetbrains.kotlin:kotlin-gradle-plugin: Just remove the variable inside the path and let this way: Hope it help you! hugs. |
Obrigado pela ajuda. |
What I find out about this problem; the channels do not work on this version of the plugin: 1:- Message notifications without payload display correctly; the disadvantage is that, when clicking on this type of notification, the application opens without receiving the notification data. this is the solution proposed by @lordStrider Payload { Client Initialization : const push = PushNotification.init({ push.on('registration', (data) => { push.on('notification', (data) => { push.on('error', (e) => { 2:- Message notifications with payload (on clicking on this type of notification the application opens by receiving the notification data.) With this payload the notifications will only be displayed if we comment out the "channel_id":"Important" property afterwards, on the client side we simply initialize the plugin without creating any channel. example: { If we add a channel in the payload or on the client, the notification will not be received if the application is killed or in the background |
@kenfouo in file config.xml add |
Bug Report
Push notifications on Android cannot be received when the application is closed or in background, in a Android 12 device using targetSdkVersion 31 and plugin version 4.0.0-dev.0 from #185 (comment)
Expected Behaviour
Receive push notifications on Android 12 devices when app is closed or in background
Actual Behaviour
Push notifications on Android cannot be received when the application is closed or in background
Reproduce Scenario (including but not limited to)
Send any push notification to Android 12 device when app is closed or in background
Steps to Reproduce
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
Android 12 using targetSdkVersion 31
(Android) Device Vendor (e.g. Samsung, HTC, Sony...)
Samsung Galaxy S10
cordova info
PrintoutLogs taken while reproducing problem
adb logcat
outputThe text was updated successfully, but these errors were encountered: