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)
    ...
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Boolean isSilent(Context context, Bundle bundle) Return true to silence a Notification.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • isSilent

         abstract Boolean isSilent(Context context, Bundle bundle)

        Return true to silence a Notification. Silent notifications will not be presented to the user.

        Parameters:
        context - The application context
        bundle - Notification extras
        Returns:

        true if this notification should not be presented