Class CommunicationListener

java.lang.Object
com.gimbal.android.CommunicationListener

public abstract class CommunicationListener extends Object
Interface definition for a callback to be invoked when Gimbal Communications arrive.
  • 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 - Communications retrieved from Gimbal Manager
      visit - the visit that triggered the Communications
      Returns:
      a Collection containing all the Communication 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 - Communications retrieved from the Gimbal Manager
      push - the type of push (Instant or Time Triggered) that triggered the Communications
      Returns:
      a Collection containing all the Communication objects you would like Gimbal to schedule for notification
    • onNotificationClicked

      public void onNotificationClicked(List<Communication> communications)
      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 by presentNotificationForCommunications(). Override this to provide a custom notification for display. If null 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 delivered
      visit - the visit that triggered the communication
      notificationId - 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 the presentNotificationForCommunications(). A notification built from the return value will be scheduled for display. Or if null 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 delivered
      push - the type of push (Instant or Time Triggered) that triggered the Communication
      notificationId - an integer ID associated with this notification.
      Returns:
      a Notification.Builder to be used by the SDK to customize the notification