-
Notifications
You must be signed in to change notification settings - Fork 37
Add writeTag support for iOS #52
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
Comments
Oh cool! |
I've added code to do a little PoC of this feature, but in my tests (on line 165) Here's the (commented) code.. feel free to play with it: nativescript-nfc/src/nfc.ios.ts Lines 150 to 171 in d4414b3
|
I'm trying to use your snippet. While the |
Looking forward to this working |
Maybe it's somehow connected to NativeScript/ios-jsc#1251 ? There is also native object transforms to JS without needed methods. I've tested app with latest version of ios-platform (that consist fix of that error) - nfcNdefTag.writeNDEFCompletionHandler still undefined :( |
Do you guys need any help? I need this feature and may be you've already made some progress or I can start working on this. |
No progress. iOS write to NFC still dosent work for me |
Check this out: https://github.com/chariotsolutions/phonegap-nfc The problem is that beginSession() is used instead of scanNdef(). "On iOS, the user must start a NFC session to scan for a tag. This is different from Android which can constantly scan for NFC tags. The nfc.scanNdef and nfc.scanTag functions start a NFC scanning session. The NFC tag is returned to the caller via a Promise. If your existing code uses the deprecated nfc.beginSession, update it to use nfc.scanNdef." They recently fixed this on phonegap-nfc: chariotsolutions/phonegap-nfc@a3b1e3a |
A PR would be very much appreciated! |
Sure, but it will take time as I don't have the dev env set up for iOS. I am developing for Android now. I am happy to help. I've never done a PR in my life, but I am eager to learn :D |
Perhaps we have to call queryNDEFStatus before trying writeNDEF as per https://developer.apple.com/documentation/corenfc/nfcndeftag/3075574-writendef?language=objc. Found this native Swift sample app code for iOS
But I dont know how to implement this in Nativescript :D |
@EddyVerbruggen: I've done good progress on implementing writeTag for iOS, it actually works, please check here: https://github.com/demetrius-tech/nativescript-nfc/blob/dev-ios-write-uid/src/nfc.ios.ts Kindly support me in finding a solution for getting the UID #55 I'm pretty desperate. |
@demetrius-tech - what is the status of this feature? it seems that we'll have to add some obj-c code to make it work? |
@timh5 it was working in the past, with version 7. Let me check if I committed the code in my repo and I will support you for free, as I don't have much time for other projects. |
writing to a tag is now supported in iOS 13.
see
writeNDEF
at https://developer.apple.com/documentation/corenfc/nfcndeftagThe text was updated successfully, but these errors were encountered: