Do an action on a gadget.
This method tries to perform the action with both internet and Bluetooth communication methods, possibly in parallel.
The callback provides global success/error status, plus detailed status information for each method. In particular, the sequence of callbacks is guaranteed to be:
onSuccess
or onError
.onInternetStatus
, then exactly one of onInternetSuccess
or onInternetError
.onBluetoothStatus
or onBluetoothStatusProgress
, then exactly one of onBluetoothSuccess
or onBluetoothError
.For Bluetooth, the SDK does some high-priority syncing before the action and some low-priority syncing after, so after the global onSuccess
or onError
is called you may still receive Bluetooth status updates. In this case, we recommend you show the success/failure to the user immediately to not make them wait, but still show a Bluetooth icon with a spinning indicator to convey there's still Bluetooth activity.
ID for the session to use.
Gadget ID, in the format "gad_3vms1xqucnus4ppfnl9h".
Action ID.
Options customizing the action.
The callback that will be called on success or error.
A function that cancels the ongoing action operation.
Add a session to the session store.
If the session store already contains the session, this is a noop. This does a network call to the server to check the session token, and to cache the session data into local storage.
The session token.
A promise that resolves to the session ID.
Get the gadgets for a session.
The session ID.
A promise that resolves to an array with all the gadgets in the session.
Get a list of hardware accessible by this session.
The session ID.
A promise that resolves to an array with all the hardware in the session.
Get the IDs for all sessions in the session store.
A promise that resolves to an array with the IDs of all sessions.
Get the version of the Akiles SDK.
A promise that resolves to the version string of the SDK.
Returns whether Bluetooth is supported on this phone.
This checks for the presence of Bluetooth LE hardware and requires Android 10 (API 29) or newer.
true if Bluetooth is supported, false otherwise.
Returns whether card emulation is supported on this phone.
This checks for the presence of NFC Host Card Emulation hardware.
true if card emulation is supported, false otherwise.
Returns whether secure NFC is supported on this phone.
true if card secure NFC is supported, false otherwise.
Refresh the cached session data for all sessions.
Refresh the cached session data.
The session ID.
Removes all sessions from the session store.
Remove a session from the session store.
If there's no session in the store with the given ID, this is a noop.
The session ID to remove.
Scan using Bluetooth for nearby Akiles devices.
The sequence of callbacks is guaranteed to be zero or more onDiscover
, then exactly one of onSuccess
or onError
.
The callback that will be called on success or error.
A function that cancels the ongoing scan operation.
Scan a card using NFC.
The result will be notified via events:
scan_card_success
: { card: { uid, isAkilesCard } }scan_card_error
: { error: { code, description } }The callback that will be called on success or error.
A function that cancels the ongoing scanCard operation.
iOS ONLY - Start a card emulation session.
Do not call this on Android. Card emulation on Android works system-wide out of the box, the only requirements is your app is installed and the session has been added. The user doesn't even have to open the app.
Synchronize state of hardware.
The sequence of callbacks is guaranteed to be zero or more onStatus
or onStatusProgress
, then exactly one of onSuccess
or onError
.
ID for the session to use.
Hardware ID, in the format "hw_3vms1xqucnus4ppfnl9h".
The callback that will be called on success or error.
A function that cancels the ongoing sync operation.
Cordova global akiles object.