Are you able to use CoreNFC in app extensions such as iMesssage or Today Widgets?

293 views Asked by At

I tried to add core NFC to my today widget and iMessage extension and I didn't get any compiler errors. When I run the actual code to bring it up, no crashes occur but it errors with an unknown error. I know when CoreNFC came out that error came up quite often and it was typically something involving entitlements or permission.

Since it got all the way to the point that the delegate was being successfully called I was wondering if I was doing something wrong to get it to come up.

Is it possible?

1

There are 1 answers

1
len On BEST ANSWER

I was wondering why Xcode didn't have the UI in place for adding the entitlement to an extension. Then I saw this in the docs:

https://developer.apple.com/documentation/corenfc?language=objc

Note

Core NFC requires a device that supports Near Field Communication. Core NFC cannot be used in app extensions.