FakeNfcAndroidHostApi class
The Android half of the platform side, answering without a channel.
It stands in for the oldest phone this package runs on: an API 24 device with NFC switched on. Every capability that arrived later answers false, and the two switches that do not exist on such a phone -- the reader option and the tag intent preference -- answer true, because that is what their own accessors report when the platform has no such switch. False there would tell a test the user had turned something off.
It is a phone rather than a tag, though: the calls that address a tag succeed and hand back an answer of the right shape and no content.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- pigeonVar_binaryMessenger → BinaryMessenger?
-
finalinherited
- pigeonVar_messageChannelSuffix → String
-
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
checkTagIntentSetup(
) → Future< TagIntentSetupPigeon> - Everything that decides whether a tag intent can reach this app, in one call.
-
disableForegroundDispatch(
) → Future< void> -
disableNfcEvents(
) → Future< void> -
disableReaderMode(
) → Future< void> -
enableForegroundDispatch(
) → Future< void> - Claims tag delivery while the activity is in the foreground, so a tag cannot be hijacked by another app's intent filter.
-
enableNfcEvents(
) → Future< bool> -
Starts delivering
onNfcEvent. False on a device below API 36. -
enableReaderMode(
List< ReaderFlagPigeon> flags, int presenceCheckDelayMillis) → Future<void> -
The raw escape hatch: full control over
NfcAdapter.enableReaderModeflags, for combinations the cross-platformstartSessiondoes not express. -
getAntennaInfo(
) → Future< NfcAntennaInfoPigeon?> - Where the antennas are, so an app can say where to hold the tag. API 34 and above; null below, and on a device that publishes no geometry.
-
getMaxTransceiveLength(
String handle, AndroidTechPigeon tech) → Future< int> -
getTimeout(
String handle, AndroidTechPigeon tech) → Future< int> -
hceAidsForService(
CardEmulationCategoryPigeon category) → Future< List< String> > - The AIDs currently registered against this app's service, static and dynamic together -- the readback for hceRegisterAids.
-
hceCategoryAllowsForegroundPreference(
CardEmulationCategoryPigeon category) → Future< bool> - Whether hceSetPreferredService has any effect for this category. Always false for payment on a device where the user's wallet choice is final.
-
hceIsDefaultServiceForAid(
String aid) → Future< bool> -
Whether this app's service is the one a reader selecting
aidwould reach. -
hceIsDefaultServiceForCategory(
CardEmulationCategoryPigeon category) → Future< bool> - Whether this app's service is the user's default for the category.
-
hceIsObserveModeEnabled(
) → Future< bool> -
hceIsObserveModeSupported(
) → Future< bool> -
hceIsSupported(
) → Future< bool> -
hceRegisterAids(
List< String> aids) → Future<bool> -
Registers AIDs against the plugin's
HostApduServiceat run time, so an app does not have to ship a static AID list in its manifest. -
hceRegisterPollingLoopFilter(
String filter, bool autoTransact) → Future< bool> -
Delivers polling frames whose bytes are exactly
filter, as uppercase hex. -
hceRegisterPollingLoopPatternFilter(
String pattern, bool autoTransact) → Future< bool> -
As hceRegisterPollingLoopFilter, but
patternis a regular expression matched against the frame's hex. -
hceRemovePollingLoopFilter(
String filter) → Future< bool> -
hceRemovePollingLoopPatternFilter(
String pattern) → Future< bool> -
hceRespond(
Uint8List response) → Future< void> -
Answers the APDU most recently delivered to
onApduReceived. -
hceSelectionModeForCategory(
CardEmulationCategoryPigeon category) → Future< AidSelectionModePigeon> - How the platform picks between apps that claim the same AID in this category.
-
hceSetDefaultToObserveMode(
bool shouldDefault) → Future< bool> - Whether the service should come up in observe mode whenever it becomes preferred, rather than needing hceSetObserveModeEnabled each time.
-
hceSetObserveModeEnabled(
bool enabled) → Future< bool> - Stops the device answering readers and starts delivering their polling frames instead. Only the preferred service may change this, so pair it with hceSetPreferredService.
-
hceSetPreferredService(
bool preferred) → Future< void> - Makes this app the preferred handler while it is in the foreground, so a tap reaches it rather than the user's default wallet.
-
hceSupportsAidPrefixRegistration(
) → Future< bool> - Whether the controller can route an AID prefix at all. Registering a prefix on hardware that cannot simply fails, with nothing to distinguish it from a bad AID.
-
hceUnregisterAids(
) → Future< bool> -
isEnabled(
) → Future< bool> -
isReaderOptionEnabled(
) → Future< bool> - Whether tag reading is switched on, which is separate from the adapter being on.
-
isReaderOptionSupported(
) → Future< bool> - Whether the device implements the Android 15 reader-option switch. False below API 35.
-
isSecureNfcEnabled(
) → Future< bool> -
isSecureNfcSupported(
) → Future< bool> -
isTagIntentAllowed(
) → Future< bool> - Whether the user has allowed this app to be launched by a tag. True below API 36.
-
isTagIntentAppPreferenceSupported(
) → Future< bool> - Whether the device implements the Android 16 tag-scan allowlist.
-
mifareClassicAuthenticateSector(
String handle, int sectorIndex, Uint8List key, bool useKeyA) → Future< bool> -
mifareClassicBlockCountInSector(
String handle, int sectorIndex) → Future< int> -
mifareClassicBlockToSector(
String handle, int blockIndex) → Future< int> - Sector geometry is not uniform -- a 4K card has 32 sectors of 4 blocks then 8 of 16 -- so this cannot be computed from blockCount and sectorCount. Reads a static description rather than talking to the tag, so it needs no connection.
-
mifareClassicDecrement(
String handle, int blockIndex, int value) → Future< void> -
mifareClassicIncrement(
String handle, int blockIndex, int value) → Future< void> -
mifareClassicReadBlock(
String handle, int blockIndex) → Future< Uint8List> -
mifareClassicRestore(
String handle, int blockIndex) → Future< void> -
mifareClassicSectorToBlock(
String handle, int sectorIndex) → Future< int> -
mifareClassicTransfer(
String handle, int blockIndex) → Future< void> -
mifareClassicWriteBlock(
String handle, int blockIndex, Uint8List data) → Future< void> -
mifareUltralightReadPages(
String handle, int pageOffset) → Future< Uint8List> -
mifareUltralightWritePage(
String handle, int pageOffset, Uint8List data) → Future< void> -
ndefFormat(
String handle, NdefMessagePigeon firstMessage, bool readOnly) → Future< void> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openNfcSettings(
) → Future< bool> - Opens the system NFC settings screen. False when there is no activity to start it from, or the device has no such screen.
-
openTagIntentPreferenceSettings(
) → Future< bool> - Opens the system screen where the user changes that. False when there is no activity to start it from, or the device has no such screen.
-
resetDiscoveryTechnology(
) → Future< void> -
resetTech(
String handle, AndroidTechPigeon tech) → Future< void> - Closes the connection to the tag and opens it again, which reselects it in the RF field.
-
setDiscoveryTechnology(
List< PollTechPigeon> poll, List<ListenTechPigeon> listen) → Future<void> - Restricts what the controller polls for and answers as, for as long as the activity is in the foreground. API 35 and above.
-
setTimeout(
String handle, AndroidTechPigeon tech, int timeout) → Future< void> -
takeInitialTag(
) → Future< TagPigeon?> - The tag whose intent launched the app, if any. Consumed by the first call.
-
toString(
) → String -
A string representation of this object.
inherited
-
transceive(
String handle, AndroidTechPigeon tech, Uint8List data) → Future< Uint8List>
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited