Notification Config
Configuration class for building Notifications. These setting will apply to all notifications generated by Marigold.
Functions
Adds an Action to an action category.
Adds an action category.
Add your own notification extender to customise the look of received notifications
To customise the appearance or content of a notification, implement as many NotificationCompat.Extenders as you like
Having access to the NotificationCompat.Builder means you can change pretty much whatever you like about the style and content of the notification. Check out the Android Developer docs here for more info.
Note that if any extenders are added, they will by default override Marigold’s notification extender. If you’d like us to still do our default notification extension, you can manually re-extend using NotificationExtender
For example, if you want to change the title of push notifications with the custom field special_price
, you could implement the following NotificationCompat.Extender:
Sets color
Supply a ContentIntentBuilder to be called when a notification is tapped
Supply an Intent to send when the notification is tapped.
Sets the notification channel on Oreo devices or later. Inaccessible pre-Oreo The NotificationChannel should be used for notification settings (vibration, sound, LED, etc) on devices >= Oreo instead of the options in this class, as it allows users more granular control of notification settings.
Set the default notification options that will be used. The value should be one or more of the following fields combined with a bitwise-or: Notification.DEFAULT_SOUND
, Notification.DEFAULT_VIBRATE
, Notification.DEFAULT_LIGHTS
. For all default values, use Notification.DEFAULT_ALL
.
Set the large icon that is shown in the ticker and notification.
Set the argb value that you would like the LED on the device to blink, as well as the rate. The rate is specified in terms of the number of milliseconds to be on and then the number of milliseconds to be off.
If you want certain notifications to be silent set your implementation of NotificationSilencer
Set the small icon to use in the notification layouts. Different classes of devices may return different sizes. See the Android UX guidelines for more information on how to design these icons.
Set the sound to play. It will play on the default stream. On some platforms, a notification that is noisy is more likely to be presented as a heads-up notification.
Set the vibration pattern to use. On some platforms, a notification that vibrates is more likely to be presented as a heads-up notification.