flutter_mapbox_navigation icon indicating copy to clipboard operation
flutter_mapbox_navigation copied to clipboard

exception on android 12+ Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. fixed

Open R3HP opened this issue 3 years ago • 0 comments

hi tnx a lot for your package i think i have solved this exception thrown on android 12 devices

additionally there is this kotlin code snippet but i dont have kotling knowledge necessary for implementing it but adding workmanager dependency and enabling activity export solved the problem for me.

val updatedPendingIntent = PendingIntent.getActivity(
   applicationContext,
   NOTIFICATION_REQUEST_CODE,
   updatedIntent,
   PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT // setting the mutability flag 
)

for mutable flag

val updatedPendingIntent = PendingIntent.getActivity(
   applicationContext,
   NOTIFICATION_REQUEST_CODE,
   updatedIntent,
   PendingIntent.FLAG_MUTABLE or PendingIntent.FLAG_UPDATE_CURRENT // setting the mutability flag 
)

R3HP avatar Apr 01 '22 19:04 R3HP