Modules.Nfc.NfcNDEFTagTechnology
Provides access to NDEF tag and I/O operations on a Modules.Nfc.NfcNDEFTag
Use the Modules.Nfc.createTagTechNdef method to create this NDEF tag technology.
Extends: Titanium.Proxy · Since: 3.0.1 · Platforms: iphone, ipad
Methods #
connect #
Call to connect NfcNDEFTag from session NFCNDEFReaderSession, connection success or failure result in a didConnectTag event.
Returns: void
queryNDEFStatus #
Asks the reader session for the NDEF support status of the tag. Success/Failure result in a didQueryNDEFStatus event.
Returns: void
readNDEF #
Retrieves an NDEF message from the tag. Success/Failure result in a didReadNDEFMessage event.
Returns: void
writeLock #
Changes the NDEF tag status to read-only, preventing future write operations. Success/Failure result in a didWriteLock event.
Returns: void
writeNDEF #
Saves an NDEF message to a writable tag. Success/Failure result in a didWirteNDEFMessage event.
Returns: void
Events #
didConnectTag #
A event called when NFCNDEFReaderSession try to connect with NDEF tag
A tag stays connected until your app connects to a different tag or restarts polling. Connecting to a tag that is already connected has no effect.
| Name | Type | Summary |
|---|---|---|
errorCode | Number | The error code. |
errorDescription | String | A string containing the localized description of the error. |
errorDomain | String | A string containing the error domain. |
didQueryNDEFStatus #
Asks the reader session for the NDEF support status of the tag.
Asks the reader session (NFCNDEFReaderSession) for the NDEF support status of the tag.
| Name | Type | Summary |
|---|---|---|
errorCode | Number | The error code. |
errorDescription | String | A string containing the localized description of the error. |
errorDomain | String | A string containing the error domain. |
status | Number | Constants that indicate status for an NDEF tag. |
capacity | Number | Indicates the maximum NDEF message size, in bytes, that you can store on the tag. |
didReadNDEFMessage #
Retrieves an NDEF message from the tag.
Retrieves an NDEF message from the tag.
| Name | Type | Summary |
|---|---|---|
errorCode | Number | The error code. |
errorDescription | String | A string containing the localized description of the error. |
errorDomain | String | A string containing the error domain. |
message | Modules.Nfc.NdefMessage | An NFC NDEF message consisting of an array of payload records. |
didWirteNDEFMessage #
Saves an NDEF message to a writable tag.
To determine whether the tag is writable, call queryNDEFStatus and check that the status is NFC_NDEF_READ_WRITE.
| Name | Type | Summary |
|---|---|---|
errorCode | Number | The error code. |
errorDescription | String | A string containing the localized description of the error. |
errorDomain | String | A string containing the error domain. |
didWriteLock #
Changes the NDEF tag status to read-only, preventing future write operations.
Calling this method updates the write access condition byte in the NDEF File Control of the tag's file system, thus locking the tag. This is a permanent action that you cannot undo. After locking the tag, you can no longer write data to it.
| Name | Type | Summary |
|---|---|---|
errorCode | Number | The error code. |
errorDescription | String | A string containing the localized description of the error. |
errorDomain | String | A string containing the error domain. |