Skip to content

Conversation

@dwettstein
Copy link

@dwettstein dwettstein commented Jul 24, 2024

Pull Request from original repository: chariotsolutions#470

SachinAgarwal1337 and others added 6 commits February 23, 2022 13:46
The plugin works perfectly in all devices except for Andorid 12. 
I get following error
```
 Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent
```

I see the problem is in  `createPendingIntent` Method
```
 private void createPendingIntent() {
        if (pendingIntent == null) {
            Activity activity = getActivity();
            Intent intent = new Intent(activity, activity.getClass());
            intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
            pendingIntent = PendingIntent.getActivity(activity, 0, intent, 0); // Problem in the last param here
        }
    }
```

This PR solves the problem by just adding the requried flag which also works for lower android versions
* master:
  Adding back NDEF as supported NFC format
  Fix: Android SDK 34 removes support for NFC push
  Fix: Return URL from intent when tag is unavailable
  iOS fixes
  Fix: 'new' is not available error in XCode 14.3
  Chore: Merging fixes from other forks
Starting Android 16, scanning NFC tags with URLs trigger the ACTION_VIEW intent.
See also: https://developer.android.com/develop/connectivity/nfc/nfc#dispatching
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants