revtel / react-native-nfc-manager

React Native NFC module for Android & iOS
MIT License
1.35k stars 317 forks source link

Expo config plugin - include ndef entitlement #600

Closed dylanclements closed 1 year ago

dylanclements commented 1 year ago

Adding option includeNdefEntitlement to expo config plugin that when explicitly set to false, removes NDEF entitlement.

Workaround for error Error: Asset validation failed Invalid entitlement for core nfc framework. The sdk version '16.0' and min OS version '13.0' are not compatible for the entitlement 'com.apple.developer.nfc.readersession.formats' because 'NDEF is disallowed

Error as seen in:

Doing so will allow build to be submitted to test flight.

Usage in app.json:

    "plugins": [
      [
        "react-native-nfc-manager",
        {
          "includeNdefEntitlement": false
        }
      ],
    ]

This is my first PR on open source, any feedback would be very much appreciated :)

whitedogg13 commented 1 year ago

@dylanclements thanks for investigating this strange issue, it's great!

BTW, I didn't encounter this issue before in NFC ReWriter, though it's in pure RN without EXPO, but I don't think it's related.

whitedogg13 commented 1 year ago

v3.14.2 released

sajadghawami commented 1 year ago

If anyone lands here, i also had to remove the NFC tag reading from capabilities and add it back. That added an entitlements file which was also necessary!

elan commented 1 year ago

FWIW, when we removed the NDEF tag and did a store release, it seemed to break the Universal Links functionality in iOS. Now, when scanning a tag, it offers to open up Safari and not our app. Anyone else see this?

dylanclements commented 1 year ago

@elan Doesn't seem to be the case on my app, universal linking works fine.

elan commented 1 year ago

Weird, we've had multiple reports of it breaking 🤔

elan commented 1 year ago

Out of curiosity, what Xcode version are you using?