Reference: contracts
Purpose: list the public portable contracts and their guarantees. Platforms: Android, iOS (portable
contracts); platform extensions as noted. Status: stable.
The portable contracts live in the Nementis.Maui.NFC.Contracts assembly (namespace Nementis.Maui.NFC), a
pure net10.0 library without MAUI or native dependencies. XML documentation on every member is the
authoritative per-member reference; this page groups the types by task.
Service and sessions
| Type |
Role |
INfcService |
Entry point: Capabilities, CapabilitiesChanged, StartSessionAsync(options, token). Reading capabilities has no side effects. |
NfcScanOptions, NfcScanPrompt |
Immutable scan request: discovery mode, protocol criteria, non-NDEF policy and host-localizable prompt texts. Platform records (AndroidNfcScanOptions, IosNfcScanOptions) derive from it. |
INfcScanSession |
One owned session: State, EffectiveOptions, TagDiscovered, StateChanged, Invalidated, StopAsync, ReconfigureAsync, DisposeAsync. |
NfcEffectiveScanOptions |
What the provider actually applied: backend, filtering, NDEF inspection, system UI and limitation codes. |
INfcPromptSession, INfcCompletableSession |
Update the prompt during a session; close it with a final success or failure text. |
NfcScanOnceExtensions.ScanOnceAsync |
Start, run one operation on the first tag, always close. |
INfcOperationObserver, INfcEventDispatcher |
Observe each committed result once; order notifications in headless hosts. |
NfcSessionState, NfcInvalidationReason, NfcBackend, NfcDiscoveryMode, NfcProtocol, NfcNonNdefPolicy |
Session and discovery enumerations. |
| Type |
Role |
INfcTag, NfcTagSnapshot |
One discovery lifetime with an opaque Id (not the UID) and an immutable snapshot. |
INfcTag.GetProtocol<T>() |
Returns a protocol view the tag actually supports, or null. |
INfcNdefTag, INfcNdefReadOnlyTag |
NDEF status, live read, write with optional verification; separate, explicit read-only conversion. |
INfcIso7816Tag, INfcIso7816Connection |
ISO 7816 APDUs, one-shot or on a retained connection. |
INfcIso15693Tag, INfcFeliCaTag |
Experimental command views; see the capability matrix. |
INfcMifareUltralightTag |
Four-page reads and single-page writes. |
INfcProtocolView.QueryCapabilitiesAsync |
Supported commands, native limits and experimental status of a view. |
Data
| Type |
Role |
NfcNdefMessage, NfcNdefRecord, NfcNdefTypeNameFormat |
Immutable NDEF data; source buffers are copied. |
NfcNdefSerializer |
Exact NFC Forum wire serialization and parsing. |
NfcNdefRtd, NfcNdefText |
Text and URI record creation and decoding. |
NfcNdefData, NfcNdefStatus, NfcDataProvenance |
Live or cached data, with explicit provenance. |
NfcApduCommand, NfcApduResponse |
Structured APDU and response with SW1/SW2. |
Results and effects
| Type |
Role |
NfcResult, NfcResult<T> |
One committed outcome per operation. Expected failures, including cancellation, are returned, not thrown. Value throws on failure. |
NfcError |
Code (NfcErrorCode), platform ReasonCode, PortableReasonCode, optional native domain and code. |
NfcOperationContext |
Operation, session and tag correlation identities. |
NfcOperationEffects |
Mutation (NotAttempted, Completed, OutcomeUnknown), Verification, CleanupError; preserved on failure. |
Capabilities and launch entry
| Type |
Role |
NfcCapabilitySnapshot, NfcFeatureCapability, NfcCapabilityDiagnostic |
See capabilities. |
INfcLaunchEntryService, NfcLaunchEntry, NfcLaunchEntryOptions |
Launch from a tag; see launch your app from a tag. |
Android-only features (reader and dispatch options, intent entry, raw technologies, MIFARE Classic, format,
ignore and adapter management) are in Nementis.Maui.NFC.AndroidExtensions. iOS options are in
Nementis.Maui.NFC.IosExtensions. They are never part of the portable contracts.
- Every public member: the XML documentation shipped with the NuGet packages (IntelliSense).
- Why the contracts look this way: design choices.