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

Public Member Functions

 NotificationsConfiguration ( @Nullable String unlockNotificationChannelId, @Nullable PendingIntent unlockNotificationIntent, @Nullable String bleForegroundServiceNotificationChannelId, @Nullable PendingIntent bleForegroundServiceNotificationIntent)
 
 NotificationsConfiguration ( @Nullable String unlockNotificationChannelId, @Nullable PendingIntent unlockNotificationIntent, @Nullable String bleForegroundServiceNotificationChannelId, @Nullable PendingIntent bleForegroundServiceNotificationIntent, @Nullable String pushNotificationsChannelId)
 
String getUnlockNotificationChannelId ()
 
PendingIntent getUnlockNotificationIntent ()
 
String getBleForegroundServiceNotificationChannelId ()
 
PendingIntent getBleForegroundServiceNotificationIntent ()
 
String getPushNotificationsChannelId ()
 

Detailed Description

Allows you to configure Notifications within the Mobile Connect SDK. There are two different kinds of notifications that are used by the SDK.

Firstly, the "unlock notification": If

  1. you have auto-connect enabled
  2. the user places their phone within range of a Reader
  3. That reader is configured to require a second factor (PINs mode in Command Centre)
  4. The host application is not visible on-screen

Then the SDK knows that it will need to prompt for a PIN or Fingerprint, however it also knows that this will fail as we cannot prompt when we are offscreen. Instead of connecting to the reader, the SDK will instead show a notification, telling the user to please open the host app.

Secondly, the "foreground service notification": If you configure the SDK to use Bluetooth in the background, then Android requires the app to display a persistent notification that informs the user the app is running and consuming resources. For more information, see https://developer.android.com/about/versions/oreo/background

Constructor & Destructor Documentation

◆ NotificationsConfiguration() [1/2]

com.gallagher.security.mobileaccess.NotificationsConfiguration.NotificationsConfiguration ( @Nullable String  unlockNotificationChannelId,
@Nullable PendingIntent  unlockNotificationIntent,
@Nullable String  bleForegroundServiceNotificationChannelId,
@Nullable PendingIntent  bleForegroundServiceNotificationIntent 
)

Initialize the notifications configuration

Parameters
unlockNotificationChannelId
See also
getUnlockNotificationChannelId()
Parameters
unlockNotificationIntent
See also
NotificationsConfiguration
Parameters
bleForegroundServiceNotificationChannelId
See also
NotificationsConfiguration
Parameters
bleForegroundServiceNotificationIntent
See also
NotificationsConfiguration
63 {
64 this(unlockNotificationChannelId, unlockNotificationIntent, bleForegroundServiceNotificationChannelId, bleForegroundServiceNotificationIntent, null);
65 }

◆ NotificationsConfiguration() [2/2]

com.gallagher.security.mobileaccess.NotificationsConfiguration.NotificationsConfiguration ( @Nullable String  unlockNotificationChannelId,
@Nullable PendingIntent  unlockNotificationIntent,
@Nullable String  bleForegroundServiceNotificationChannelId,
@Nullable PendingIntent  bleForegroundServiceNotificationIntent,
@Nullable String  pushNotificationsChannelId 
)
76 {
77 mUnlockNotificationChannelId = unlockNotificationChannelId;
78 mUnlockNotificationIntent = unlockNotificationIntent;
79 mBleForegroundServiceNotificationChannelId = bleForegroundServiceNotificationChannelId;
80 mBleForegroundServiceNotificationIntent = bleForegroundServiceNotificationIntent;
81 mPushNotificationsChannelId = pushNotificationsChannelId;
82 }

Member Function Documentation

◆ getBleForegroundServiceNotificationChannelId()

String com.gallagher.security.mobileaccess.NotificationsConfiguration.getBleForegroundServiceNotificationChannelId ( )
Returns
The notification channel to use to show the foreground service notification. If null, the foreground service will fail to start, and you will not be able to use Bluetooth unless your app is on-screen (or you have some other pre-existing foreground service).

Note: NFC will still work in the background even without the notification

111 {
112 return mBleForegroundServiceNotificationChannelId;
113 }

◆ getBleForegroundServiceNotificationIntent()

PendingIntent com.gallagher.security.mobileaccess.NotificationsConfiguration.getBleForegroundServiceNotificationIntent ( )
Returns
Creates an intent to execute when the foreground service notification is clicked on. This intent can launch your application for example If null, then clicking on the unlock notification will simply do nothing.
120 {
121 return mBleForegroundServiceNotificationIntent;
122 }

◆ getPushNotificationsChannelId()

String com.gallagher.security.mobileaccess.NotificationsConfiguration.getPushNotificationsChannelId ( )
128 {
129 return mPushNotificationsChannelId;
130 }

◆ getUnlockNotificationChannelId()

String com.gallagher.security.mobileaccess.NotificationsConfiguration.getUnlockNotificationChannelId ( )
Returns
The notification channel to use to show the unlock notification when it is required. If null, the SDK will not show unlock notifications which will lead to a poor user experience if they ever need to interact with readers requiring second factor authentication
90 {
91 return mUnlockNotificationChannelId;
92 }

◆ getUnlockNotificationIntent()

PendingIntent com.gallagher.security.mobileaccess.NotificationsConfiguration.getUnlockNotificationIntent ( )
Returns
Creates an intent to execute when the unlock notification is clicked on. This intent can launch your application for example If null, then clicking on the unlock notification will simply do nothing.
99 {
100 return mUnlockNotificationIntent;
101 }

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