Class GcmNotification.Builder

java.lang.Object
com.sap.mobile.services.client.push.GcmNotification.Builder
Enclosing interface:
GcmNotification

public static final class GcmNotification.Builder extends Object
Firebase/Android specific notification parameter. See @see Notifications and data messages
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • collapseKey

      public GcmNotification.Builder collapseKey(String collapseKey)
      Collapsible messages replace old messages with the same key with new messages with the same key. Android can store up to 100 messages without collapsing.
      See Also:
    • delayWhileIdle

      public GcmNotification.Builder delayWhileIdle(Boolean delayWhileIdle)
      Deprecated.
      use timeToLive instead
      Message delivery by FCM is delayed when the device is idle.
    • timeToLive

      public GcmNotification.Builder timeToLive(Duration timeToLive)
      When an app server posts a message to FCM and receives a message ID back, it does not mean that the message was already delivered to the device. Rather, it means that it was accepted for delivery. What happens to the message after it is accepted depends on many factors. This property can be used to deliver the message only in the next duration
    • restrictedPackageName

      public GcmNotification.Builder restrictedPackageName(String restrictedPackageName)
      Android allows you to use one FCM service instance for multiple apps with different package names. This property will restrict the message to apps with the given package name.
    • title

      public GcmNotification.Builder title(String title)
      If set, this field takes priority over the alert field of the notification element titleLocKey should be used to retrieve the title from the localized resources of the app based on the user's language configuration.
    • body

      public GcmNotification.Builder body(String body)
      If set, this field takes priority over the alert field of the notification element bodyLocKey should be used to retrieve the title from the localized resources of the app based on the user's language configuration.
    • icon

      public GcmNotification.Builder icon(String icon)
      Allows you to implement a custom app icon for the message instead of the default. The icon resource must be present in the app resources.
    • sound

      public GcmNotification.Builder sound(String sound)
      Allows you to play a custom sound when the message is received. If set, this field takes priority over the sound field of the notification element. The custom sound resource must be present in the app resource folder res\raw. default selects the default notification sound.
    • tag

      public GcmNotification.Builder tag(String tag)
      Notification with a tag replaces older notifications with the same tag on the device.
    • color

      public GcmNotification.Builder color(String color)
      The notification's icon color, expressed in #rrggbb format.
    • clickAction

      public GcmNotification.Builder clickAction(String clickAction)
      The action associated with a user click on the notification. If specified, an activity with a matching intent filter is launched when a user clicks on the notification.
    • bodyLocKey

      public GcmNotification.Builder bodyLocKey(String bodyLocKey)
      Should be used to retrieve the title from the localized resources of the app based on the user's language configuration.
    • bodyLocArgs

      public GcmNotification.Builder bodyLocArgs(String bodyLocArgs)
      Deprecated.
      use bodyLocArgsArray
      Serialized JSON list of body localization parameters
    • bodyLocArgsArray

      public GcmNotification.Builder bodyLocArgsArray(List<String> bodyLocArgsArray)
      List of body localization parameters
    • titleLocKey

      public GcmNotification.Builder titleLocKey(String titleLocKey)
      Should be used to retrieve the title from the localized resources of the app based on the user's language configuration.
    • titleLocArgs

      public GcmNotification.Builder titleLocArgs(String titleLocArgs)
      Deprecated.
      use titleLocArgsArray
      Serialized JSON list of title localization parameters
    • titleLocArgsArray

      public GcmNotification.Builder titleLocArgsArray(List<String> titleLocArgsArray)
      List of title localization parameters
    • build

      public GcmNotification build()