Interface NotificationActionTappedListener

  • All Implemented Interfaces:

    
    public interface NotificationActionTappedListener
    
                        

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

    For example, if you want to log when a notification action with title 'OK' is tapped.

    You could implement a listener like this:

    class MyNotificationActionTappedListener: NotificationActionTappedListener {
    private val TAG = "NotificationLogger"
    
    override onNotificationActionTapped(context: Context?, bundle: Bundle?, title: String?, category: String?, actionState: NotificationActionState) {
    if(title == "OK") {
    Log.i(TAG, "OK action tapped!")
    }
    }
    }

    Add your implementation using Marigold.addNotificationActionTappedListener

    ...
    val marigold = Marigold()
    Marigold.startEngine(getApplicationContext(), "your sdk key")
    Marigold.addNotificationActionTappedListener(MyNotificationActionTappedListener())
    ...
    • 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 onNotificationActionTapped(Context context, Bundle bundle, String title, String category, NotificationActionState actionState) 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

      • onNotificationActionTapped

         abstract Unit onNotificationActionTapped(Context context, Bundle bundle, String title, String category, NotificationActionState actionState)

        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
        title - the title of the tapped action
        category - the category the tapped action belongs to
        actionState - the NotificationActionState the application will be left in after the notification action handling