Package com.gimbal.android
Class CommunicationListener
java.lang.Object
com.gimbal.android.CommunicationListener
Interface definition for a callback to be invoked when Gimbal Communications arrive.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
onNotificationClicked
(List<Communication> communications) Called when a user clicks on a Gimbal Notification in the notification trayandroid.app.Notification.Builder
prepareCommunicationForDisplay
(Communication communication, Push push, int notificationId) Deprecated.android.app.Notification.Builder
prepareCommunicationForDisplay
(Communication communication, Visit visit, int notificationId) Called when a Place Arrival results in a Gimbal Communication retrieved from the Gimbal Manager AND communication is returned bypresentNotificationForCommunications()
.presentNotificationForCommunications
(Collection<Communication> communications, Push push) Deprecated.presentNotificationForCommunications
(Collection<Communication> communications, Visit visit) Called when a Place Arrival results in Gimbal Communications retrieved from Gimbal Manager.
-
Constructor Details
-
CommunicationListener
public CommunicationListener()
-
-
Method Details
-
presentNotificationForCommunications
public Collection<Communication> presentNotificationForCommunications(Collection<Communication> communications, Visit visit) Called when a Place Arrival results in Gimbal Communications retrieved from Gimbal Manager. Any Communications returned in the result in a Notification. Communications not returned are not scheduled. Frequency limit and delay are not honored for communications not returned.- Parameters:
communications
-Communication
s retrieved from Gimbal Managervisit
- the visit that triggered the Communications- Returns:
- a
Collection
containing all theCommunication
objects you would like Gimbal to schedule for notification
-
presentNotificationForCommunications
@Deprecated public Collection<Communication> presentNotificationForCommunications(Collection<Communication> communications, Push push) Deprecated.Called when Gimbal Manager pushes an Instant or Time Triggered Communication to this listener. Any Communications returned in the result will result in a Notification. Communications not returned are not scheduled. Frequency limit and delay are not honored for communications not returned.- Parameters:
communications
-Communication
s retrieved from the Gimbal Managerpush
- the type of push (Instant or Time Triggered) that triggered the Communications- Returns:
- a
Collection
containing all theCommunication
objects you would like Gimbal to schedule for notification
-
onNotificationClicked
Called when a user clicks on a Gimbal Notification in the notification tray- Parameters:
communications
- Communications associated with the Notification
-
prepareCommunicationForDisplay
public android.app.Notification.Builder prepareCommunicationForDisplay(Communication communication, Visit visit, int notificationId) Called when a Place Arrival results in a Gimbal Communication retrieved from the Gimbal Manager AND communication is returned bypresentNotificationForCommunications()
. Override this to provide a custom notification for display. Ifnull
is returned, a default notification will be scheduled for the communication.NOTE: Set a Notification Channel on this builder when running on an Android 8.0 or later device when your app targets API 26 or higher.
- Parameters:
communication
- the communication for which a notification is to be deliveredvisit
- the visit that triggered the communicationnotificationId
- an integer ID associated with this notification- Returns:
- a
Notification.Builder
object to be used by the SDK to customize the notification
-
prepareCommunicationForDisplay
@Deprecated public android.app.Notification.Builder prepareCommunicationForDisplay(Communication communication, Push push, int notificationId) Deprecated.Called when an Instant or Time Triggered Communication is received from Gimbal Manager AND a communication is returned by thepresentNotificationForCommunications()
. A notification built from the return value will be scheduled for display. Or ifnull
is returned, a default notification for the Communication will be scheduled.Set a Notification Channel on this builder when running on an Android 8.0 or later device when your app targets API 26 or higher.
- Parameters:
communication
- the Communication for which a notification is to be deliveredpush
- the type of push (Instant or Time Triggered) that triggered the CommunicationnotificationId
- an integer ID associated with this notification.- Returns:
- a
Notification.Builder
to be used by the SDK to customize the notification
-