Gallagher Mobile Connect SDK
Public Member Functions | List of all members
com.gallagher.security.mobileaccess.MobileAccess Interface Reference

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< MobileCredentialgetMobileCredentials ()
 
Collection< MobileCredentialgetMobileCredentials (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< MobileAccessStategetMobileAccessStates ()
 
void setIsBluetoothEnabledInApp (boolean isEnabled)
 
BluetoothAdvertisementScanner newBluetoothAdvertisementScanner ()
 
Collection< SdkFeatureStategetSdkFeatureStates ()
 
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
 

Detailed Description

Primary interface for communicating via the Mobile Access SDK. Use MobileAccessProvider for getting an instance of the SDK.

Member Function Documentation

◆ addAutomaticAccessListener()

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

Parameters
accessListenerThe access listener that will start having it's relevant methods called in response to automatic access attempts/errors/results

◆ addDigitalIdListener()

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

Parameters
listenerThe listener that will start having it's relevant methods called with Digital ID updates

◆ addReaderUpdateListener()

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

◆ addSaltoUpdateListener()

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

Parameters
listenerThe listener that will start having its relevant methods called with Salto Key updates

◆ addSdkFeatureStateListener()

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

◆ addSdkStateListener()

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

Parameters
listenerCallback object which will receive state updates.

◆ deleteMobileCredential()

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

Parameters
mobileCredentialthe credential to delete
deleteOptionAdvanced usage if you need to delete credentials while offline.
listenerCallback interface to notify about the result from the delete operation.
Exceptions
RuntimeExceptionif the credential does not exist.

◆ enumerateReaderActions()

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.

Parameters
readerThe reader. Obtained from the ReaderUpdateListener callback
listenerCallback object which will receive the list of actions, or an error.

◆ getAutomaticAccessEnabled()

boolean com.gallagher.security.mobileaccess.MobileAccess.getAutomaticAccessEnabled ( )

Returns whether automatic access is currently enabled.
Must be invoked on the main thread

See also
setAutomaticAccessEnabled setAutomaticAccessEnabled(boolean)

◆ getBluetoothBackgroundScanMode()

BluetoothScanMode com.gallagher.security.mobileaccess.MobileAccess.getBluetoothBackgroundScanMode ( )

Returns the current background scan mode for BLE.
Must be invoked on the main thread

See also
setBluetoothBackgroundScanMode setBluetoothBackgroundScanMode(BluetoothScanMode)

◆ getMobileAccessStates()

Collection< MobileAccessState > com.gallagher.security.mobileaccess.MobileAccess.getMobileAccessStates ( )

Synchronously gets the states of the SDK

Returns
The states of the SDK as a collection

◆ getMobileCredential()

MobileCredential com.gallagher.security.mobileaccess.MobileAccess.getMobileCredential ( @NonNull String  credentialId)

Gets a Mobile Credential by it's identifier.

Returns
The credential, or null if the credentialId did not match any registered credentials

◆ getMobileCredentials() [1/2]

Collection< MobileCredential > com.gallagher.security.mobileaccess.MobileAccess.getMobileCredentials ( )

Gets all registered Mobile Credentials

Returns
List of credentials

◆ getMobileCredentials() [2/2]

Collection< MobileCredential > com.gallagher.security.mobileaccess.MobileAccess.getMobileCredentials ( MobileCredentialFilter  options)

Gets registered Mobile Credentials, optionally filtering out revoked credentials

Returns
List of credentials

◆ getSdkFeatureStates()

Collection< SdkFeatureState > com.gallagher.security.mobileaccess.MobileAccess.getSdkFeatureStates ( )

Synchronously gets the feature states of the SDK

Returns
The feature states of the SDK as a collection

◆ registerCredential()

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

Parameters
uriThe fully qualified credential invitation URI.
listenerCallback interface for the process.

◆ removeAutomaticAccessListener()

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.

Parameters
accessListenerAn instance of an access listener to remove. The functions on this object will not be called back on anymore

◆ removeDigitalIdListener()

void com.gallagher.security.mobileaccess.MobileAccess.removeDigitalIdListener ( @NonNull DigitalIdListener  listener)

Removes a Digital ID listener by reference Can be invoked from any thread

Parameters
listenerAn instance of a Digital ID listener to remove. The functions on this object will not be called back on anymore

◆ removeReaderUpdateListener()

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

◆ removeSaltoUpdateListener()

void com.gallagher.security.mobileaccess.MobileAccess.removeSaltoUpdateListener ( @NonNull SaltoUpdateListener  listener)

Removes a Salto listener by reference Can be invoked from any thread

Parameters
listenerAn instance of a Salto listener to remove. The functions on this object will not be called back on anymore

◆ removeSdkFeatureStateListener()

void com.gallagher.security.mobileaccess.MobileAccess.removeSdkFeatureStateListener ( @NonNull SdkFeatureStateListener  listener)

Removes a feature state listener by reference.

Parameters
listenerAn instance of a feature state listener to remove. The functions on this object will not be called back on anymore.

◆ removeSdkStateListener()

void com.gallagher.security.mobileaccess.MobileAccess.removeSdkStateListener ( @NonNull SdkStateListener  listener)

Removes a listener previously added by addSdkStateListener

Parameters
listenerThe listener callback object to remove

◆ requestAccess()

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.

Parameters
readerThe reader to request access by
listenerThe listener to callback on when access is granted, denied or a general error condition occurs.

◆ requestReaderAction()

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.

Parameters
readerThe reader. Obtained from the ReaderUpdateListener callback
actionThe action to request. Obtained by calling enumerateReaderActions
listenerCallback object to notify about success/failure

◆ resolveInvitationUri()

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

◆ setAutomaticAccessEnabled()

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.

See also
MobileAccess::setScanning(boolean)
MobileAccess::addAutomaticAccessListener(AutomaticAccessListener)
MobileAccess::removeAutomaticAccessListener(AutomaticAccessListener)

◆ setBluetoothBackgroundScanMode()

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

Parameters
bluetoothScanModeThe scan mode that will be applied when the screen is off.

◆ setBluetoothConnectionSensitivity()

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

Parameters
bluetoothConnectionSensitivityThe 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

◆ setIsBluetoothEnabledInApp()

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.

Parameters
isEnabledDetermines if Bluetooth is enabled at the SDK level

◆ setIsNfcPreferred()

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.

Parameters
isNfcPreferredDetermines if NFC is preferred over BLE when attempting to auto-connect

◆ setScanning()

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:

  • At least one credential registered.
  • Device PIN or passcode must be set
  • Bluetooth or NFC on

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.

Parameters
enabledIf true, will try and start scanning. If false, will stop scanning
See also
getMobileAccessStates getMobileAccessStates - for potential scanning problems and warnings

◆ startOpeningSaltoDoor() [1/2]

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

Parameters
saltoKeyIdentifierThe Salto Key Identifier the user wants access with
listenerThe listener to callback on when access is granted, denied or a general error condition occurs

◆ startOpeningSaltoDoor() [2/2]

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

Parameters
saltoKeyIdentifierThe Salto Key Identifier the user wants access with
listenerThe listener to callback on when access is granted, denied or a general error condition occurs
paramsAdditional parameters for opening a Salto Door

◆ syncCredentialItemUpdates() [1/2]

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

◆ syncCredentialItemUpdates() [2/2]

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.

Parameters
onSyncCompletedThe 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

The documentation for this interface was generated from the following file: