Notification Tapped Listener
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!")
}
}
}
Content copied to clipboard
Add your implementation using Marigold.addNotificationTappedListener
...
val marigold = Marigold()
marigold.startEngine(getApplicationContext(), "your sdk key")
marigold.addNotificationTappedListener(MyNotificationTappedListener())
...
Content copied to clipboard