Gallagher Mobile Connect SDK
|
Public Member Functions | |
void | registerCredential (@NonNull URI uri, @NonNull RegistrationListener listener) |
void | authenticateCredential (@NonNull MobileCredential mobileCredential, @NonNull MobileCredentialAuthType authType, Boolean isSecondFactor, int requestTimeout, @NonNull JwtResultListener resultListener) |
Collection< MobileCredential > | getMobileCredentials () |
Collection< MobileCredential > | getMobileCredentials (MobileCredentialFilter options) |
MobileCredential | getMobileCredential (@NonNull String credentialId) |
void | deleteMobileCredential (@NonNull MobileCredential mobileCredential, @NonNull final DeleteOption deleteOption, @Nullable CredentialDeleteListener listener) |
void | setScanning (boolean enabled) |
URI | resolveInvitationUri (@NonNull String invitationBaseUrl, @NonNull String invitationCode) throws URISyntaxException |
void | requestAccess (@NonNull Reader reader, @NonNull AccessListener listener) |
void | requestReaderAction (@NonNull Reader reader, @NonNull ReaderAction action, @NonNull ReaderActionListener listener) |
void | enumerateReaderActions (@NonNull Reader reader, @NonNull ReaderActionEnumerationListener listener) |
void | addSdkStateListener (@NonNull SdkStateListener listener) |
void | removeSdkStateListener (@NonNull SdkStateListener listener) |
void | addReaderUpdateListener (@NonNull ReaderUpdateListener readerUpdateListener) |
void | removeReaderUpdateListener (@NonNull ReaderUpdateListener readerUpdateListener) |
void | addAutomaticAccessListener (@NonNull AutomaticAccessListener accessListener) |
void | removeAutomaticAccessListener (@NonNull AutomaticAccessListener accessListener) |
boolean | getAutomaticAccessEnabled () |
void | setAutomaticAccessEnabled (boolean enabled) |
BluetoothScanMode | getBluetoothBackgroundScanMode () |
void | setBluetoothBackgroundScanMode (@NonNull BluetoothScanMode bluetoothScanMode) |
void | setBluetoothConnectionSensitivity (@NonNull BluetoothConnectionSensitivity bluetoothConnectionSensitivity) |
void | setIsNfcPreferred (boolean isNfcPreferred) |
Collection< MobileAccessState > | getMobileAccessStates () |
void | setIsBluetoothEnabledInApp (boolean isEnabled) |
BluetoothAdvertisementScanner | newBluetoothAdvertisementScanner () |
Collection< SdkFeatureState > | getSdkFeatureStates () |
void | addSdkFeatureStateListener (@NonNull SdkFeatureStateListener listener) |
void | removeSdkFeatureStateListener (@NonNull SdkFeatureStateListener listener) |
void | syncCredentialItemUpdates () |
void | syncCredentialItemUpdates (Runnable1< Throwable > onSyncCompleted) |
void | addDigitalIdListener (@NonNull DigitalIdListener listener) |
void | removeDigitalIdListener (@NonNull DigitalIdListener listener) |
void | addSaltoUpdateListener (@NonNull SaltoUpdateListener listener) |
void | removeSaltoUpdateListener (@NonNull SaltoUpdateListener listener) |
void | addAperioUpdateListener (@NonNull AperioUpdateListener listener) |
void | removeAperioUpdateListener (@NonNull AperioUpdateListener listener) |
void | addTotpUpdateListener (@NonNull TotpUpdateListener listener) |
void | removeTotpUpdateListener (@NonNull TotpUpdateListener listener) |
void | addNotificationsListener (@NonNull NotificationsListener listener) |
void | removeNotificationsListener (@NonNull NotificationsListener listener) |
void | sendNotificationToken (@NonNull String firebaseToken, @Nullable List< MobileCredential > forCredentials, @NonNull Runnable1< SendNotificationTokenResult > onSendCompleted) |
void | markNotificationAsRead (@NonNull Notification notification) |
void | deleteNotification (@NonNull Notification notification) |
void | startOpeningSaltoDoor (@NonNull SaltoKeyIdentifier saltoKeyIdentifier, @NonNull SaltoAccessListener listener) |
void | startOpeningSaltoDoor (@NonNull SaltoKeyIdentifier saltoKeyIdentifier, @NonNull SaltoAccessListener listener, @NonNull SaltoOpeningParams params) |
void | addE2eListener (E2eEncryptionListener listener) |
void | removeE2eListener (E2eEncryptionListener listener) |
E2ePublicKeys | getE2eSiteAndDeviceKeysForDisplay (MobileCredential mobileCredential) throws EncryptionError |
Primary interface for communicating via the Mobile Access SDK. Use MobileAccessProvider
for getting an instance of the SDK.
void com.gallagher.security.mobileaccess.MobileAccess.addAutomaticAccessListener | ( | @NonNull AutomaticAccessListener | accessListener | ) |
The access listener to add and listen out for automatic access attempts from inside the SDK
accessListener | The access listener that will start having it's relevant methods called in response to automatic access attempts/errors/results |
void com.gallagher.security.mobileaccess.MobileAccess.addDigitalIdListener | ( | @NonNull DigitalIdListener | listener | ) |
Add a listener for handling Digital IDs available to registered Mobile Credentials Can be invoked from any thread
listener | The listener that will start having it's relevant methods called with Digital ID updates |
void com.gallagher.security.mobileaccess.MobileAccess.addReaderUpdateListener | ( | @NonNull ReaderUpdateListener | readerUpdateListener | ) |
Adds a listener for listening to updates from readers Can be invoked from any thread
void com.gallagher.security.mobileaccess.MobileAccess.addSaltoUpdateListener | ( | @NonNull SaltoUpdateListener | listener | ) |
Add a listener for handling Salto Keys available to registered MobileCredentials Can be invoked from any thread
listener | The listener that will start having its relevant methods called with Salto Key updates |
void com.gallagher.security.mobileaccess.MobileAccess.addSdkFeatureStateListener | ( | @NonNull SdkFeatureStateListener | listener | ) |
Listens to the feature states of the SDK. Warnings and errors will be announced via the handler provided
void com.gallagher.security.mobileaccess.MobileAccess.addSdkStateListener | ( | @NonNull SdkStateListener | listener | ) |
Listens to the state of the SDK. Warnings and errors (such as Bluetooth being powered off) will be announced via the listener
listener | Callback object which will receive state updates. |
void com.gallagher.security.mobileaccess.MobileAccess.deleteMobileCredential | ( | @NonNull MobileCredential | mobileCredential, |
@NonNull final DeleteOption | deleteOption, | ||
@Nullable CredentialDeleteListener | listener | ||
) |
Deletes a mobile credential.
The default behaviour is for the SDK to also contact the Gallagher Cloud, and delete the credential record from the cloud before removing the entry from the local SDK's data store.
This means that if the internet connection is offline, the method will fail and the credential will not be deleted, which is the recommended behaviour.
If you do really need to delete a credential from the local SDK while offline, you can supply ALLOW_OFFLINE or OFFLINE_ONLY for deleteOption
mobileCredential | the credential to delete |
deleteOption | Advanced usage if you need to delete credentials while offline. |
listener | Callback interface to notify about the result from the delete operation. |
RuntimeException | if the credential does not exist. |
void com.gallagher.security.mobileaccess.MobileAccess.enumerateReaderActions | ( | @NonNull Reader | reader, |
@NonNull ReaderActionEnumerationListener | listener | ||
) |
Asks the reader for the list of currently available actions - such as arming the alarm zone, unlocking the door, etc.
reader | The reader. Obtained from the ReaderUpdateListener callback |
listener | Callback object which will receive the list of actions, or an error. |
boolean com.gallagher.security.mobileaccess.MobileAccess.getAutomaticAccessEnabled | ( | ) |
Returns whether automatic access is currently enabled.
Must be invoked on the main thread
BluetoothScanMode com.gallagher.security.mobileaccess.MobileAccess.getBluetoothBackgroundScanMode | ( | ) |
Returns the current background scan mode for BLE.
Must be invoked on the main thread
Collection< MobileAccessState > com.gallagher.security.mobileaccess.MobileAccess.getMobileAccessStates | ( | ) |
Synchronously gets the states of the SDK
MobileCredential com.gallagher.security.mobileaccess.MobileAccess.getMobileCredential | ( | @NonNull String | credentialId | ) |
Gets a Mobile Credential by it's identifier.
Collection< MobileCredential > com.gallagher.security.mobileaccess.MobileAccess.getMobileCredentials | ( | ) |
Gets all registered Mobile Credentials
Collection< MobileCredential > com.gallagher.security.mobileaccess.MobileAccess.getMobileCredentials | ( | MobileCredentialFilter | options | ) |
Gets registered Mobile Credentials, optionally filtering out revoked credentials
Collection< SdkFeatureState > com.gallagher.security.mobileaccess.MobileAccess.getSdkFeatureStates | ( | ) |
Synchronously gets the feature states of the SDK
void com.gallagher.security.mobileaccess.MobileAccess.registerCredential | ( | @NonNull URI | uri, |
@NonNull RegistrationListener | listener | ||
) |
Starts registration for a new Mobile Credential. Supply a RegistrationListener
to be notified about, and interact with the registration process
Note: A fully qualified invitation URI looks like this:
https://commandcentre-ap-southeast-2.security.gallagher.cloud/api/invitations/J7ZU-EJU4-RMCU-KNCU
If you do not have a fully qualified URI, and only have the unique code on the end, you can use resolveInvitationUri
to build a fully qualified URI
uri | The fully qualified credential invitation URI. |
listener | Callback interface for the process. |
void com.gallagher.security.mobileaccess.MobileAccess.removeAutomaticAccessListener | ( | @NonNull AutomaticAccessListener | accessListener | ) |
Removes an automatic access listener by reference. If the listener is has not been added then this effectively becomes a no-op.
accessListener | An instance of an access listener to remove. The functions on this object will not be called back on anymore |
void com.gallagher.security.mobileaccess.MobileAccess.removeDigitalIdListener | ( | @NonNull DigitalIdListener | listener | ) |
Removes a Digital ID listener by reference Can be invoked from any thread
listener | An instance of a Digital ID listener to remove. The functions on this object will not be called back on anymore |
void com.gallagher.security.mobileaccess.MobileAccess.removeReaderUpdateListener | ( | @NonNull ReaderUpdateListener | readerUpdateListener | ) |
Removes a listener for listening to updates from readers Can be invoked from any thread
void com.gallagher.security.mobileaccess.MobileAccess.removeSaltoUpdateListener | ( | @NonNull SaltoUpdateListener | listener | ) |
Removes a Salto listener by reference Can be invoked from any thread
listener | An instance of a Salto listener to remove. The functions on this object will not be called back on anymore |
void com.gallagher.security.mobileaccess.MobileAccess.removeSdkFeatureStateListener | ( | @NonNull SdkFeatureStateListener | listener | ) |
Removes a feature state listener by reference.
listener | An instance of a feature state listener to remove. The functions on this object will not be called back on anymore. |
void com.gallagher.security.mobileaccess.MobileAccess.removeSdkStateListener | ( | @NonNull SdkStateListener | listener | ) |
Removes a listener previously added by addSdkStateListener
listener | The listener callback object to remove |
void com.gallagher.security.mobileaccess.MobileAccess.requestAccess | ( | @NonNull Reader | reader, |
@NonNull AccessListener | listener | ||
) |
Requests access via a particular reader and calls back to the appropriate functions on the specified listener.
reader | The reader to request access by |
listener | The listener to callback on when access is granted, denied or a general error condition occurs. |
void com.gallagher.security.mobileaccess.MobileAccess.requestReaderAction | ( | @NonNull Reader | reader, |
@NonNull ReaderAction | action, | ||
@NonNull ReaderActionListener | listener | ||
) |
Request an action, such as arming the alarm zone, unlocking the door, etc.
reader | The reader. Obtained from the ReaderUpdateListener callback |
action | The action to request. Obtained by calling enumerateReaderActions |
listener | Callback object to notify about success/failure |
URI com.gallagher.security.mobileaccess.MobileAccess.resolveInvitationUri | ( | @NonNull String | invitationBaseUrl, |
@NonNull String | invitationCode | ||
) | throws URISyntaxException |
Resolves invitations for URL's against a Command Centre Cloud server given a common base URL, and an invitation code
void com.gallagher.security.mobileaccess.MobileAccess.setAutomaticAccessEnabled | ( | boolean | enabled | ) |
Allows the SDK to carry out automatic access attempts. If the automatic access attempts are already allowed, then this effectively becomes a no-op. Automatic access attempts are disabled by default.
In order for automatic access attempts to work you must also instruct the SDK to start scanning for devices.
void com.gallagher.security.mobileaccess.MobileAccess.setBluetoothBackgroundScanMode | ( | @NonNull BluetoothScanMode | bluetoothScanMode | ) |
Describes the power-level of bluetooth scanning while the screen is off i.e. in the background. When the screen is on, the scanner will always scan in high-power mode unless BLE has been disabled in the app by the user.
Can be invoked on any thread
bluetoothScanMode | The scan mode that will be applied when the screen is off. |
void com.gallagher.security.mobileaccess.MobileAccess.setBluetoothConnectionSensitivity | ( | @NonNull BluetoothConnectionSensitivity | bluetoothConnectionSensitivity | ) |
Sets the connection sensitivity for when auto connect can be applied.
This is useful on Android devices due to the varying capabilities of bluetooth antennas. The intent of this is to allow users marginally make changes to the configured path-loss sensitivities being broadcast by a reader
bluetoothConnectionSensitivity | The adjustment that should be made to to the configured path-loss value in order for the mobile device to be more sensitive to BLE auto-connect |
void com.gallagher.security.mobileaccess.MobileAccess.setIsBluetoothEnabledInApp | ( | boolean | isEnabled | ) |
If this is set to false, the SDK will not use Bluetooth at all and only NFC connections will be possible. This value is true by default.
isEnabled | Determines if Bluetooth is enabled at the SDK level |
void com.gallagher.security.mobileaccess.MobileAccess.setIsNfcPreferred | ( | boolean | isNfcPreferred | ) |
Sets if NFC communications should be preferred over BLE if applicable e.g.
If this is set to true and there is a bluetooth enabled reader with NFC enabled, the device will not try and auto-connect over BLE when it detects that it can. It will instead wait for NFC if NFC has not already started communicating.
isNfcPreferred | Determines if NFC is preferred over BLE when attempting to auto-connect |
void com.gallagher.security.mobileaccess.MobileAccess.setScanning | ( | boolean | enabled | ) |
Starts or Stops scanning for readers.
This will start/stop auto-connect attempts if the current SDK instance is configured to do automatic access attempts
For the SDK to start scanning it requires:
You can call setScanning(true) at any point, and the SDK in the background will only start scanning once all preconditions are true.
Note: There is no "isScanning" because the value of whether or not we are scanning depends on a variety of things and can change rapidly. If you want to track whether the SDK is currently scanning or not, please use addSdkStateListener
to provide a callback.
Can be invoked from any thread.
enabled | If true, will try and start scanning. If false, will stop scanning |
void com.gallagher.security.mobileaccess.MobileAccess.startOpeningSaltoDoor | ( | @NonNull SaltoKeyIdentifier | saltoKeyIdentifier, |
@NonNull SaltoAccessListener | listener | ||
) |
Start opening a Salto Door with a given Salto Key Identifier using default opening parameters with 'STANDARD_MODE' opening mode
saltoKeyIdentifier | The Salto Key Identifier the user wants access with |
listener | The listener to callback on when access is granted, denied or a general error condition occurs |
void com.gallagher.security.mobileaccess.MobileAccess.startOpeningSaltoDoor | ( | @NonNull SaltoKeyIdentifier | saltoKeyIdentifier, |
@NonNull SaltoAccessListener | listener, | ||
@NonNull SaltoOpeningParams | params | ||
) |
Start opening a Salto Door with a given Salto Key Identifier using specified opening parameters
saltoKeyIdentifier | The Salto Key Identifier the user wants access with |
listener | The listener to callback on when access is granted, denied or a general error condition occurs |
params | Additional parameters for opening a Salto Door |
void com.gallagher.security.mobileaccess.MobileAccess.syncCredentialItemUpdates | ( | ) |
Triggers an async request to the Gallagher cloud for related item updates for registered mobile credentials Resulting updates for Notifications, Salto Keys, Digital IDs will be published through associated listeners
void com.gallagher.security.mobileaccess.MobileAccess.syncCredentialItemUpdates | ( | Runnable1< Throwable > | onSyncCompleted | ) |
Triggers an async request to the Gallagher cloud for related item updates for registered mobile credentials, and notifies you when the sync completes.
onSyncCompleted | The callback to be called when the sync completes. If the sync fails, then the callback will be called with an Error object. If the sync succeeds, the Error object will be null Resulting updates for Notifications, Salto Keys, Digital IDs will be published through associated listeners |