Reference: reason codes
Purpose: map the stable reason codes in results and capability reports to their meaning. Platforms: Android, iOS. Status: stable.
Every NfcError and NfcFeatureCapability carries two codes:
ReasonCode: the detailed, platform-specific code (for exampleandroid.tag.outOfDate). Use it for logs and diagnostics.PortableReasonCode: one of the portable codes below, identical on Android and iOS. Use it for shared control flow and localized messages.
Never parse exception or native messages; codes are stable identifiers. Payloads, identifiers, commands and keys are never part of a code.
Portable codes
Defined as constants in NfcReasonCodes.
| Code | Meaning |
|---|---|
portable.hardware.missing |
NFC hardware is unavailable. |
portable.radio.disabled |
The NFC radio or a required reader option is disabled. |
portable.configuration.missing |
Host permissions or configuration are missing. |
portable.session.required |
An active scan session is required. |
portable.tag.required |
An active tag is required; the tag was lost, replaced or its session ended. |
portable.busy |
A competing session or operation owns the required resource. |
portable.feature.notImplemented |
The provider does not implement the feature. |
portable.platform.unsupported |
The platform does not expose the feature. |
portable.protocol.absentOnTag |
The tag does not expose the required protocol or technology. |
portable.ndef.readOnly |
The NDEF mutation is blocked because the tag is read-only. |
portable.operation.cancelled |
Cancellation committed as the final outcome. |
portable.operation.timeout |
A timeout committed as the final outcome. |
portable.operation.invalidData |
Malformed or unsupported data was supplied or received. |
portable.operation.ioFailure |
A native input/output failure occurred. |
portable.operation.capacityExceeded |
A mutation or command exceeded a known capacity limit. |
portable.operation.authenticationFailed |
Authentication failed. |
portable.operation.resourceFailure |
Native cleanup or resource release failed; see quarantine. |
portable.verification.unavailable |
A requested read-back after a completed write could not observe the content. |
portable.generic |
No stronger portable category applies, for example a documented behavioral limitation. |
Mapping from error codes
When a platform code has no exact mapping, PortableReasonCode follows NfcError.Code:
NfcErrorCode |
Portable code |
|---|---|
NotAvailable |
portable.hardware.missing |
Configuration |
portable.configuration.missing |
Unsupported |
portable.platform.unsupported |
Busy |
portable.busy |
InvalidTag, SessionEnded, TagLost |
portable.tag.required |
AuthenticationFailed |
portable.operation.authenticationFailed |
InvalidData |
portable.operation.invalidData |
CapacityExceeded |
portable.operation.capacityExceeded |
ReadOnly |
portable.ndef.readOnly |
IoFailure |
portable.operation.ioFailure |
Timeout |
portable.operation.timeout |
Cancelled |
portable.operation.cancelled |
ResourceFailure |
portable.operation.resourceFailure |
Frequent platform codes
| Code | Platform | Meaning | Details |
|---|---|---|---|
session.owner.timeout |
both | Activation did not obtain the owner before ActivationTimeout. |
ownership |
scanOnce.cancelled, scanOnce.timeout |
both | ScanOnceAsync was cancelled or timed out. |
README |
ndef.verify.mismatch, ndef.verify.unavailable |
both | Read-back after a write differed or could not be observed. | write with verification |
connection.cleanup.pending |
both | Native cleanup has not finished after five seconds. | quarantine |
android.tag.outOfDate |
Android | The tag handle was retired by the platform (tag gone). | ownership |
android.permission.nfc.denied |
Android | The NFC permission is missing. | host configuration |
android.ndef.read.nullAmbiguous |
Android | A null live read can mean an empty tag or a failed native read. | Read again on a new tap; see write with verification |
iso7816.extended.unsupported |
Android | The device does not support extended-length APDUs. | ISO 7816 |
ios.configuration.readerSessionFormats.declarationAndEntitlement |
iOS | ReaderSessionFormats does not declare TAG. |
host configuration |
ios.configuration.entitlementOrProvisioning |
iOS | Core NFC rejected the signed entitlements or provisioning. | host configuration |
protocol.experimental |
both | Diagnostic: the feature still needs physical-device evidence. | capability matrix |
Launch-entry codes
The launch-entry reason codes, their kind, platforms and portable codes are generated in the
capability matrix. Each diagnostic and the NFC1700-NFC1703
build codes have a row with cause and fix in the
diagnostics reference of the launch-from-tag guide.