Gallagher Mobile Connect SDK
Static Public Member Functions | Static Public Attributes | List of all members
com.gallagher.security.mobileaccess.MobileAccessProvider Class Reference

Static Public Member Functions

static MobileAccess configure (@NonNull Application application, @Nullable String databaseFilePath, @Nullable String unlockNotificationChannelId, @Nullable String bleServiceForegroundNotificationChannelId)
 
static synchronized MobileAccess configure ( @NonNull Application application, @Nullable String databaseFilePath, @Nullable NotificationsConfiguration notificationsConfiguration, @NonNull EnumSet< SdkFeature > enabledFeatures, @NonNull CloudTlsValidationMode cloudTlsValidationMode, @Nullable Map< String, Object > config)
 
static synchronized MobileAccess getInstance ()
 

Static Public Attributes

static final Long TOTP_ALLOWABLE_TIME_WINDOW_SECONDS = 30L
 

Detailed Description

Provides instances of the Mobile Access API.

Member Function Documentation

◆ configure() [1/2]

static synchronized MobileAccess com.gallagher.security.mobileaccess.MobileAccessProvider.configure ( @NonNull Application  application,
@Nullable String  databaseFilePath,
@Nullable NotificationsConfiguration  notificationsConfiguration,
@NonNull EnumSet< SdkFeature enabledFeatures,
@NonNull CloudTlsValidationMode  cloudTlsValidationMode,
@Nullable Map< String, Object >  config 
)
static

Use this method to configure the SDK before doing anything else. It is not possible to re-configure the SDK once this has been called..

Parameters
applicationThe android Application object
databaseFilePathYou may specify a custom file path and name for the Mobile Access SDK database. If you decide to specify a custom file path, it is recommended to put it under the Android NoBackupFiles directory - accessed via context.getNoBackupFilesDir(). If existing registrations exist, changing the database file path will make them unavailable. Make sure the database file path stays the same once deployed to user devices. A default name of 'com.gallagher.security.mobileaccess.db' is used if null is passed in for this parameter.
notificationsConfigurationConfiguration for the SDK to use when creating notifications (for example to tell you to unlock your device for access)
enabledFeaturesList of SdkFeatureSets for which features to enable status and error reporting on
cloudTlsValidationModeUse to override the default cloud server certificate validation procedure. You should specify CloudTlsValidationMode.ANY_VALID_CERTIFICATE_REQUIRED
configPrivate for Gallagher internal use. Pass null here.
67 {
68 // Gallagher Internal Note: This is the real method that the Mobile Connect app uses, the other overloads are for compatibility with SDK users
69
70 // If we have already called configure
71 if (sMobileAccess != null) {
72 throw new FatalError("Cannot call configure twice");
73 }
74
75 // Set defaults for the parameters that have been omitted
76 if (databaseFilePath == null) {
77 databaseFilePath = new File(application.getNoBackupFilesDir(), "com.gallagher.security.mobileaccess.db").getPath();
78 }
79
80 // Remove the built-in BouncyCastle we can use a version we specify
81 Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
82 Security.addProvider(new BouncyCastleProvider());
83
84 // Create the SDK singleton
85 sMobileAccess = new DefaultMobileAccess(application, databaseFilePath, cloudTlsValidationMode, enabledFeatures, notificationsConfiguration, config);
86 return sMobileAccess;
87 }

◆ configure() [2/2]

static MobileAccess com.gallagher.security.mobileaccess.MobileAccessProvider.configure ( @NonNull Application  application,
@Nullable String  databaseFilePath,
@Nullable String  unlockNotificationChannelId,
@Nullable String  bleServiceForegroundNotificationChannelId 
)
static

Convenience overload to configure the SDK for backwards compatibility

32 {
33
34 // set up the fido authenticators module
35 FidoAuthenticatorsHelpers.setupAuthenticators();
36
37 return configure(
38 application,
39 databaseFilePath,
40 new NotificationsConfiguration(unlockNotificationChannelId, null, bleServiceForegroundNotificationChannelId, null),
41 EnumSet.noneOf(SdkFeature.class),
42 CloudTlsValidationMode.ANY_VALID_CERTIFICATE_REQUIRED,
43 null);
44 }
static MobileAccess configure(@NonNull Application application, @Nullable String databaseFilePath, @Nullable String unlockNotificationChannelId, @Nullable String bleServiceForegroundNotificationChannelId)
Definition: MobileAccessProvider.java:29

◆ getInstance()

static synchronized MobileAccess com.gallagher.security.mobileaccess.MobileAccessProvider.getInstance ( )
static
89 {
90 if (sMobileAccess == null) {
91 throw new FatalError("Call configure before calling getInstance");
92 }
93
94 return sMobileAccess;
95 }

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