Package com.leanplum

Interface LeanplumPushNotificationCustomizer


  • public interface LeanplumPushNotificationCustomizer
    Implement LeanplumPushNotificationCustomizer to customize the appearance of notifications.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void customize​(android.app.Notification.Builder builder, android.os.Bundle notificationPayload, android.app.Notification.Style notificationStyle)
      Implement this method to support 2 lines of text in BigPicture style push notification, otherwise implement customize(NotificationCompat.Builder, Bundle) and leave this method empty.
      void customize​(androidx.core.app.NotificationCompat.Builder builder, android.os.Bundle notificationPayload)
      Implement this method to customize push notification.
    • Method Detail

      • customize

        void customize​(android.app.Notification.Builder builder,
                       android.os.Bundle notificationPayload,
                       @Nullable
                       android.app.Notification.Style notificationStyle)
        Implement this method to support 2 lines of text in BigPicture style push notification, otherwise implement customize(NotificationCompat.Builder, Bundle) and leave this method empty. Please call LeanplumPushService.setCustomizer(LeanplumPushNotificationCustomizer, boolean) with true value to activate this method.
        Parameters:
        builder - Notification.Builder for push notification.
        notificationPayload - Bundle notification payload.
        notificationStyle - - Notification.BigPictureStyle or null - BigPicture style for current push notification. Call ((Notification.BigPictureStyle) notificationStyle).bigLargeIcon(largeIcon) if you want to set large icon on expanded push notification. If notificationStyle wasn't null it will be set to push notification. Note: If you call notificationStyle = new Notification.BigPictureStyle() or other Notification.Style - there will be no support 2 lines of text on BigPicture push and you need to call builder.setStyle(notificationStyle) to set yours expanded layout for push notification.