Enum NfcError
- All Implemented Interfaces:
Comparable<NfcError>
Typed error codes returned by
Nfc and HostCardEmulationService when an
asynchronous NFC operation fails. Callers branch on these via
NfcException.getError() instead of string-matching error messages.-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe message did not fit in the tag's writable capacity.Device has NFC hardware but the user has disabled it in system settings.The NDEF payload is malformed or the tag returned data that does not parse as a valid NDEF message.I/O failure during transceive / NDEF read / NDEF write -- typically a transient field loss that may succeed on retry.The user did not grant the NFC entitlement / permission, or the build is missing theNFCReaderUsageDescriptionplist entry on iOS / theandroid.permission.NFCmanifest entry on Android.The current platform/port does not expose an NFC API at all (desktop deploy, JavaScript, ports withoutgetNfc()overridden).Tag is read-only (already locked, or a vendor tag with no writable area) and the requested write was rejected.The OS / NFC controller cancelled the session -- app backgrounded, another reader took the radio, or the session timed out without a tag.Tag was removed from the field before the requested operation could complete.Anything not covered by the more specific codes.HCE-specific: the requested AID is not the one registered for this service, or the terminal addressed an unknown AID.Tag was discovered but reports a technology that the requested operation does not support (e.g.User dismissed the iOS Core NFC system sheet, or the Android foreground-dispatch overlay was cancelled. -
Method Summary
Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
NOT_AVAILABLE
-
DISABLED
Device has NFC hardware but the user has disabled it in system settings. On Android this corresponds toNfcAdapter.isEnabled()returningfalse; iOS does not expose a runtime toggle so this code is rarely returned there. -
NOT_AUTHORIZED
The user did not grant the NFC entitlement / permission, or the build is missing theNFCReaderUsageDescriptionplist entry on iOS / theandroid.permission.NFCmanifest entry on Android. -
TAG_LOST
Tag was removed from the field before the requested operation could complete. The caller should re-arm the reader and re-prompt the user. -
INVALID_NDEF
The NDEF payload is malformed or the tag returned data that does not parse as a valid NDEF message. -
READ_ONLY
Tag is read-only (already locked, or a vendor tag with no writable area) and the requested write was rejected. -
CAPACITY_EXCEEDED
The message did not fit in the tag's writable capacity. SeeTag.getMaxNdefSize()before constructing large messages. -
IO_ERROR
I/O failure during transceive / NDEF read / NDEF write -- typically a transient field loss that may succeed on retry. -
UNSUPPORTED_TAG
-
USER_CANCELED
User dismissed the iOS Core NFC system sheet, or the Android foreground-dispatch overlay was cancelled. -
SYSTEM_CANCELED
The OS / NFC controller cancelled the session -- app backgrounded, another reader took the radio, or the session timed out without a tag. -
UNKNOWN_AID
HCE-specific: the requested AID is not the one registered for this service, or the terminal addressed an unknown AID. -
UNKNOWN
Anything not covered by the more specific codes.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-