NotificationTappedListener

Listener used to identify when a notification was tapped



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

Functions

Link copied to clipboard
abstract fun onNotificationTapped(context: Context, bundle: Bundle)

Called when the notification is tapped