NotificationActionTappedListener

Listener used to identify when a notification action was tapped



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())
...

Functions

Link copied to clipboard
abstract fun onNotificationActionTapped(context: Context, bundle: Bundle, title: String, category: String, actionState: NotificationActionState)

Called when the notification is tapped