Package com.swrve.sdk

Class SwrveNotificationConfig.Builder

  • Enclosing class:
    SwrveNotificationConfig

    public static class SwrveNotificationConfig.Builder
    extends java.lang.Object
    • Constructor Detail

      • Builder

        public Builder​(int iconDrawableId,
                       int iconMaterialDrawableId,
                       android.app.NotificationChannel defaultNotificationChannel)
        Builder constructor
        Parameters:
        iconDrawableId - the notification icon drawable to be shown in the status bar for below api level 21
        iconMaterialDrawableId - the notification icon drawable to be shown in the status bar for above api level 20
        defaultNotificationChannel - Set the default notification channel used to display notifications. This is required if you target Android O (API 26) or higher. We recommend that the channel is created before setting it in our config. Our SDK will attempt to create it if it doesn't exist.
    • Method Detail

      • activityClass

        public SwrveNotificationConfig.Builder activityClass​(java.lang.Class<?> activityClass)
        Set the activity class to open when the notification is engaged with.
        Parameters:
        activityClass - The Activity class
        Returns:
        this builder
      • largeIconDrawableId

        public SwrveNotificationConfig.Builder largeIconDrawableId​(int largeIconDrawableId)
        Set the icon to display if not configured by swrve dashboard
        Parameters:
        largeIconDrawableId - drawable icon id
        Returns:
        this builder
      • accentColorHex

        public SwrveNotificationConfig.Builder accentColorHex​(java.lang.String accentColorHex)
        Set the default accent color to use in the notification
        Parameters:
        accentColorHex - hex color string value for the color.
        Returns:
        this builder
      • notificationFilter

        public SwrveNotificationConfig.Builder notificationFilter​(SwrveNotificationFilter notificationFilter)
        Set the notification filter used for modifying remote notifications before they are displayed. If filtering Geo Notifications, please use the SwrveGeoCustomFilter
        Parameters:
        notificationFilter - the notification filter to apply
        Returns:
        this builder