Push

class Push

Batch Push module

Properties

Link copied to clipboard
val ALERT_KEY: String = "msg"
Key to retrieve the Alert message
Link copied to clipboard
val BODY_KEY: String = "msg"
Key to retrieve the body of a push message
Link copied to clipboard
val PAYLOAD_KEY: String = "batchPushPayload"
Key to retrieve the GCM payload from the activity launch intent
Link copied to clipboard
val TITLE_KEY: String = "title"
Key to retrieve the Title of the message (optional)

Functions

Link copied to clipboard
open fun appendBatchData(pushIntent: Intent, openIntent: Intent)
open fun appendBatchData(@NonNull pushIntentExtras: Bundle, @NonNull openIntent: Intent)
open fun appendBatchData(@NonNull remoteMessage: RemoteMessage, @NonNull openIntent: Intent)
Append Batch data to your open intent so that opens from this push will be tracked by Batch and displayed into your dashboard.
Link copied to clipboard
Dismiss all notifications shown by the application.
Link copied to clipboard
open fun displayNotification(context: Context, intent: Intent)
open fun displayNotification(context: Context, intent: Intent, bypassManualMode: Boolean)
open fun displayNotification(@NonNull context: Context, @NonNull intent: Intent, @Nullable interceptor: BatchNotificationInterceptor, bypassManualMode: Boolean)
Call this method to display the notification for this intent.
open fun displayNotification(context: Context, remoteMessage: RemoteMessage)
open fun displayNotification(@NonNull context: Context, @NonNull remoteMessage: RemoteMessage, @Nullable interceptor: BatchNotificationInterceptor)
Call this method to display the notification for this message.
Link copied to clipboard
Get the channels manager, allowing you to tweak how notifications will behave regarding the channels feature introduced in Android 8.
Link copied to clipboard
Get the current push registration.
Link copied to clipboard
open fun isBatchPush(intent: Intent): Boolean
open fun isBatchPush(message: RemoteMessage): Boolean
Check if the received push is a Batch one.
Link copied to clipboard
Get manual display mode for push notifications.
Link copied to clipboard
open fun makePendingIntent(@NonNull context: Context, @NonNull intent: Intent, @NonNull pushIntentExtras: Bundle): PendingIntent
open fun makePendingIntent(@NonNull context: Context, @NonNull intent: Intent, @NonNull remoteMessage: RemoteMessage): PendingIntent
Make a PendingIntent suitable for notifications from a given Intent.
Link copied to clipboard
open fun makePendingIntentForDeeplink(@NonNull context: Context, @NonNull deeplink: String, @NonNull pushIntentExtras: Bundle): PendingIntent
open fun makePendingIntentForDeeplink(@NonNull context: Context, @NonNull deeplink: String, @NonNull remoteMessage: RemoteMessage): PendingIntent
Make a PendingIntent suitable for notifications from a given deeplink.
Link copied to clipboard
open fun onNotificationDisplayed(context: Context, intent: Intent)
open fun onNotificationDisplayed(context: Context, remoteMessage: RemoteMessage)
Call this method when you just displayed a Batch push notification by yourself.
Link copied to clipboard
Force Batch to renew the push token.
Link copied to clipboard
Request the notification runtime permission.
Link copied to clipboard
Sets additional intent flags for notifications.
Link copied to clipboard
open fun setLargeIcon(largeIcon: Bitmap)
Set a custom large icon that push notifications will use.
Link copied to clipboard
open fun setManualDisplay(manualDisplay: Boolean)
Set manual display mode for push notifications.
Link copied to clipboard
Set a notification interceptor.
Link copied to clipboard
open fun setNotificationsColor(@ColorInt argbColor: Int)
Set the notification accent color for Lollipop or later.
Link copied to clipboard
Adjust the way Batch will display notifications.
Link copied to clipboard
open fun setSmallIconResourceId(@DrawableRes resourceId: Int)
Set a custom small icon resource that push notifications will use.
Link copied to clipboard
open fun setSound(uri: Uri)
Set a custom sound uri that push notifications will use.
Link copied to clipboard
open fun shouldDisplayPush(context: Context, intent: Intent): Boolean
open fun shouldDisplayPush(context: Context, remoteMessage: RemoteMessage): Boolean
Should the developer handle and display this push, or will Batch display it?
Link copied to clipboard
Whether Batch should show notifications or not.