Skip to content
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

App crashes when targeting version 31 and above when hitting "notification:received" #86

Open
lkellett-tfo opened this issue Nov 30, 2022 · 0 comments

Comments

@lkellett-tfo
Copy link

Hi, I've got an issue when running the app with target SDK 31 / Android 12. The app builds fine, but crashes almost immediately after receiving a notification. A notification does not actually appear, but a breakpoint in window.plugins.PushbotsPlugin.on("notification:received", function (data) {}) was hit.

Android Studio: 2021.3.1 Patch 1 (Mac Intel)
minSdkVersion 24
targetSdkVersion 31
Cordova 10.0.0
cordova android 11.0.0
pushbots-cordova-plugin: 1.6.21

java.lang.IllegalArgumentException: test.exampleco.exampleapp: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
	at android.app.PendingIntent.checkFlags(PendingIntent.java:377)
	at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:460)
	at android.app.PendingIntent.getActivity(PendingIntent.java:446)
	at android.app.PendingIntent.getActivity(PendingIntent.java:410)
	at com.pushbots.push.PBNotificationIntent.createNotification(PBNotificationIntent.java:485)
	at com.pushbots.push.PBNotificationIntent.buildNotification(PBNotificationIntent.java:88)
	at com.pushbots.push.PBNotification.generateNotificationInner(PBNotification.java:78)
	at com.pushbots.push.PBNotification.generateNotification(PBNotification.java:71)
	at com.pushbots.push.PBGenerateNotification.generateNotification(PBGenerateNotification.java:120)
	at com.pushbots.push.PBGenerateNotification.generateNotification(PBGenerateNotification.java:94)
	at com.pushbots.push.GcmIntentJobService.startProcessing(GcmIntentJobService.java:78)
	at com.pushbots.push.PBJobServiceBase$1.run(PBJobServiceBase.java:23)
	at java.lang.Thread.run(Thread.java:920)

This appears that as the plugin has not been updated in some time, it breaks compatibility with this SDK version. It's not something I can try and fix directly as the issue is in the core com.pushbots.push package. Is this plugin able to be updated? Or maybe it is something on my end? Thanks for having a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant