Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NFCTagReaderSession init unavailable in SDK 14.5 #449

Conversation

christiaan
Copy link

Since iPhoneOS14.5 the init function has been marked as unavailable.

Example error:

 /usr/local/opt/actions-runner/_work/mobile-app/mobile-app/platforms/ios/Leviy/Plugins/phonegap-nfc/NfcPlugin.m:128:53: error: 'new' is unavailable
            self.nfcSession = [[NFCTagReaderSession new]
                                                    ^
In module 'CoreNFC' imported from /usr/local/opt/actions-runner/_work/mobile-app/mobile-app/platforms/ios/Leviy/Plugins/phonegap-nfc/NfcPlugin.h:11:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk/System/Library/Frameworks/CoreNFC.framework/Headers/NFCTagReaderSession.h:100:1: note: 'init' has been explicitly marked unavailable here
- (instancetype)init NS_UNAVAILABLE;
^

Fixes #448

Since iPhoneOS14.5 the init function has been marked as unavailable.
@christiaan
Copy link
Author

I have not been able to verify this actually works. I could compile it and run in the simulator.

@pmanup
Copy link

pmanup commented Apr 28, 2021

I have not been able to verify this actually works. I could compile it and run in the simulator.

yes, work

@gnarco
Copy link

gnarco commented Apr 30, 2021

I confirm, it works.

Could it be merged ?

@kamil-hammouche
Copy link

I'm encountering the same issue after updating Xcode to 12.5

            self.nfcSession = [[NFCTagReaderSession new]
                       initWithPollingOption:(NFCPollingISO14443 | NFCPollingISO15693)
                       delegate:self queue:dispatch_get_main_queue()];

The error is : 'new' is unavailable

How to fix this ?

@christiaan
Copy link
Author

I'm encountering the same issue after updating Xcode to 12.5

            self.nfcSession = [[NFCTagReaderSession new]
                       initWithPollingOption:(NFCPollingISO14443 | NFCPollingISO15693)
                       delegate:self queue:dispatch_get_main_queue()];

The error is : 'new' is unavailable

How to fix this ?

Wait for this PR to be merged. Or use the branch of this PR directly in your package.json.

-    "phonegap-nfc": "^1.2.0",
+    "phonegap-nfc": "github:christiaan/phonegap-nfc#master_fix-ios-new-disabled",

@gnarco
Copy link

gnarco commented May 5, 2021

Do you know when this PR will be merged and pushed to NPM ? Are we talking in days or weeks ?

@gnarco
Copy link

gnarco commented May 17, 2021

@don what's the process for merging ?

Thanks !

@marioshtika
Copy link

New update. I am not having this problem after updating to Xcode 13.

@christiaan
Copy link
Author

New update. I am not having this problem after updating to Xcode 13.

I can confirm that this is not needed anymore.

@christiaan christiaan closed this Jan 19, 2022
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.

Compiling error NFCTagReaderSession
6 participants