Interface NotificationTappedListener

  • All Implemented Interfaces:

    
    public interface NotificationTappedListener
    
                        

    Listener used to identify when a notification was tapped <br></br><br></br>

    For example, if you want to log when a notification with the custom field 'special_price' present is tapped.

    You could implement a listener like this:

    class MyNotificationTappedListener: NotificationTappedListener {
    private val TAG = "NotificationLogger"
    
    override onNotificationTapped(context: Context?, bundle: Bundle) {
    if(bundle.containsKey("special_price")) {
    Log.i(TAG, "Sale Notification tapped! That's a good push!")
    }
    }
    }

    Add your implementation using Marigold.addNotificationTappedListener

    ...
    val marigold = Marigold()
    marigold.startEngine(getApplicationContext(), "your sdk key")
    marigold.addNotificationTappedListener(MyNotificationTappedListener())
    ...
    • 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 Unit onNotificationTapped(Context context, Bundle bundle) Called when the notification is tappedNote: You should not try to load/save data to Marigold directly from this method
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • onNotificationTapped

         abstract Unit onNotificationTapped(Context context, Bundle bundle)

        Called when the notification is tapped

        Note: You should not try to load/save data to Marigold directly from this method

        Parameters:
        context - the application context
        bundle - notification data