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
105 stars 50 forks source link

[Bug]: com.onesignal.GenerateNotification.getNewActionPendingIntent #354

Open ermancibo opened 1 year ago

ermancibo commented 1 year ago

What happened?

com.onesignal.GenerateNotification.getNewActionPendingIntent GenerateNotification.java, line 195 java.lang.IllegalArgumentException: 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?

installed nuget Com.OneSignal v 3.10.6

What did you expect to happen?

when comes notification apps going to crash

OneSignal Xamarin SDK version

3.10.6

Which platform(s) are affected?

Relevant log output

No response

Code of Conduct

55nhatnam55 commented 1 year ago

I have the same problem here. Everything work fine but when the notification comes, app crashed.

55nhatnam55 commented 1 year ago

Hi @ermancibo, I have fixed the problem by added a package Xamarin.AndroidX.Work.Runtime 2.7.0. I think the problem come when the migrate to AndroidX has some errror.

brismithers commented 1 year ago

thank you @55nhatnam55 for a solution. @ermancibo please let us know if this does not resolve the issue.