okadan / flutter-nfc-manager

A Flutter plugin for accessing the NFC features on Android and iOS.
https://pub.dev/packages/nfc_manager
MIT License
201 stars 133 forks source link

Example project App crashes after launch. #193

Open UmairSaqibBhutta opened 4 months ago

UmairSaqibBhutta commented 4 months ago

When I run the example project on my android device then app crashes on launch and logs : 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

UmairSaqibBhutta commented 3 months ago

@fabienrousseau @ThomasAunvik @fred441a @FritzMatthaeus any help please?

euphoria3k commented 2 months ago

you need to update the MainActivity.kt file in the example project. Update line 13 to be the following:

val pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_IMMUTABLE) // Updated line