Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest version of Parse Server and the Parse Android SDK.
Issue Description
The following exception is raised with Android12 when onPushReceive is called.
And targetSDKVersion is 31.
Caused by: java.lang.IllegalArgumentException: my.package: 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:375)
at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
at com.parse.ParsePushBroadcastReceiver.getNotification(ParsePushBroadcastReceiver.java:430)
at com.parse.ParsePushBroadcastReceiver.onPushReceive(ParsePushBroadcastReceiver.java:168)
Steps to reproduce
Call ParsePushBroadcastReceiver#onPushReceive method.
Actual Outcome
Caused by: java.lang.IllegalArgumentException: my.package: 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:375)
at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
at com.parse.ParsePushBroadcastReceiver.getNotification(ParsePushBroadcastReceiver.java:430)
at com.parse.ParsePushBroadcastReceiver.onPushReceive(ParsePushBroadcastReceiver.java:168)
Expected Outcome
No exception.
Environment
any Parse Android SDK version with Android12 and targetSDKVersion 31
Parse Android SDK
- SDK version:
2.0.3
- Operating system version:
Android12