Post not yet marked as solved
Post marked as unsolved with 4 replies, 1,014 views
We have been successfully writing to NFC tags using Beta 13, but have no luck with trying to lock them using the writeLock() function. After execution we get back a result of nil but it is definitely not locking. Any clues or has anyone managed to get this work as yet?Code is extremley straight forward (but might have done something stupid!) - Trying on different variations of a NXP NTAG213 tag:if (self.lockTag) {
// locking required also
os_log("Tag needs to be locked")
tag.writeLock() { (error: Error?) in
if error != nil {
os_log("LOCK FAILED!!")
session.alertMessage = "Lock failed try again"
session.invalidate()
} else {
session.alertMessage = "Write and Lock successful"
session.invalidate()
}
}
} else {
// only writing
os_log("Tag is unlocked")
session.alertMessage = "Write successful!"
session.invalidate()
}