OneSignal / OneSignal-Xamarin-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Xamarin app with OneSignal. https://onesignal.com
Other
104 stars 50 forks source link

[Bug]: Crash when received One Signal nofication on Android Target S+ #350

Closed facilityweb closed 1 year ago

facilityweb commented 1 year ago

What happened?

i'm using OneSignal for push notification on Android . but when i change the Android target Sdk to 31 it crash when receive notification

java.lang.IllegalArgumentException: com.buscador.seguros: 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

Steps to reproduce?

send a simple notification in background, the apps crash.

What did you expect to happen?

receive notification

OneSignal Xamarin SDK version

3.10.6

Which platform(s) are affected?

Relevant log output

No response

Code of Conduct

jkasten2 commented 1 year ago

@facilityweb Thanks for the question. You need to update to the OneSignal-Xamarin-SDK 4.0.0 or newer to be compatible with projects that target Android 12. See the release notes on how to migrate to the new version: https://github.com/OneSignal/OneSignal-Xamarin-SDK/releases/tag/4.0.0

facilityweb commented 1 year ago

tks, its works