Class IterableNotificationBuilder

java.lang.Object
androidx.core.app.NotificationCompat.Builder
com.iterable.iterableapi.IterableNotificationBuilder

public class IterableNotificationBuilder
extends androidx.core.app.NotificationCompat.Builder
Created by David Truong [email protected]
  • Field Summary

    Fields inherited from class androidx.core.app.NotificationCompat.Builder

    mActions, mContext, mPeople
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected IterableNotificationBuilder​(android.content.Context context, java.lang.String channelId)
    Creates a custom Notification builder
  • Method Summary

    Modifier and Type Method Description
    android.app.Notification build()
    Combine all of the options that have been set and return a new Notification object.
    static IterableNotificationBuilder createNotification​(android.content.Context context, android.os.Bundle extras)
    Creates and returns an instance of IterableNotification.
    void createNotificationActionButton​(android.content.Context context, com.iterable.iterableapi.IterableNotificationData.Button button, android.os.Bundle extras)
    Creates a notification action button for a given JSON payload
    boolean isGhostPush()  
    static void postNotificationOnDevice​(android.content.Context context, IterableNotificationBuilder iterableNotificationBuilder)
    Posts the notification on device.
    void setExpandedContent​(java.lang.String content)
    Sets the expanded content used for backwards compatibility up to Android API 23
    void setImageUrl​(java.lang.String imageUrl)
    Sets the image url
    void setIsGhostPush​(boolean ghostPush)  

    Methods inherited from class androidx.core.app.NotificationCompat.Builder

    addAction, addAction, addExtras, addInvisibleAction, addInvisibleAction, addPerson, extend, getBigContentView, getColor, getContentView, getExtras, getHeadsUpContentView, getNotification, getPriority, getWhenIfShowing, limitCharSequenceLength, setAutoCancel, setBadgeIconType, setCategory, setChannelId, setColor, setColorized, setContent, setContentInfo, setContentIntent, setContentText, setContentTitle, setCustomBigContentView, setCustomContentView, setCustomHeadsUpContentView, setDefaults, setDeleteIntent, setExtras, setFullScreenIntent, setGroup, setGroupAlertBehavior, setGroupSummary, setLargeIcon, setLights, setLocalOnly, setNumber, setOngoing, setOnlyAlertOnce, setPriority, setProgress, setPublicVersion, setRemoteInputHistory, setShortcutId, setShowWhen, setSmallIcon, setSmallIcon, setSortKey, setSound, setSound, setStyle, setSubText, setTicker, setTicker, setTimeoutAfter, setUsesChronometer, setVibrate, setVisibility, setWhen

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IterableNotificationBuilder

      protected IterableNotificationBuilder​(android.content.Context context, java.lang.String channelId)
      Creates a custom Notification builder
      Parameters:
      context -
      channelId -
  • Method Details

    • setImageUrl

      public void setImageUrl​(java.lang.String imageUrl)
      Sets the image url
      Parameters:
      imageUrl -
    • setExpandedContent

      public void setExpandedContent​(java.lang.String content)
      Sets the expanded content used for backwards compatibility up to Android API 23
      Parameters:
      content -
    • setIsGhostPush

      public void setIsGhostPush​(boolean ghostPush)
    • isGhostPush

      public boolean isGhostPush()
    • build

      public android.app.Notification build()
      Combine all of the options that have been set and return a new Notification object. Download any optional images
      Overrides:
      build in class androidx.core.app.NotificationCompat.Builder
    • createNotificationActionButton

      public void createNotificationActionButton​(android.content.Context context, com.iterable.iterableapi.IterableNotificationData.Button button, android.os.Bundle extras)
      Creates a notification action button for a given JSON payload
      Parameters:
      context - Context
      button - `IterableNotificationData.Button` object containing button information
      extras - Notification payload
    • createNotification

      public static IterableNotificationBuilder createNotification​(android.content.Context context, android.os.Bundle extras)
      Creates and returns an instance of IterableNotification. This is kept here for backwards compatibility.
      Parameters:
      context -
      extras -
      Returns:
      Returns null if the intent comes from an Iterable ghostPush or it is not an Iterable notification
    • postNotificationOnDevice

      public static void postNotificationOnDevice​(android.content.Context context, IterableNotificationBuilder iterableNotificationBuilder)
      Posts the notification on device. Only sets the notification if it is not a ghostPush/null iterableNotification. This is kept here for backwards compatibility.
      Parameters:
      context -
      iterableNotificationBuilder - Function assumes that the iterableNotification is a ghostPush if the IterableNotification passed in is null.