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