Notification Silencer
Implement NotificationSilencer if you want to suppress any received notification to be presented by Marigold
Note: Direct to URI notifications using the _u
parameter will never call isSilent
You could use this to silence notifications from other providers or Receive a notification to start a special background service
Example of usage to silent notifications when the custom key silent
is present.
Create your implementation:
class MyNotificationSilencer: NotificationSilencer {
override isSilent(context: Context?, bundle: Bundle): Boolean {
return bundle.containsKey("silent")
}
}
Content copied to clipboard
Add your implementation using NotificationConfig.setSilencer
...
val marigold = Marigold()
marigold.startEngine(getApplicationContext(), "your sdk key")
notificationConfig = NotificationConfig()
notificationConfig.setSilencer(MyNotificationSilencer())
marigold.setNotificationConfig(notificationConfig)
...
Content copied to clipboard