Package com.marigold.sdk.interfaces
Interface NotificationReceivedListener
-
- All Implemented Interfaces:
public interface NotificationReceivedListener
Listener used to identify when a notification was received <br></br><br></br>
For example, if we want to log when receiving notifications with the custom field 'special_price' present, you could implement a listener:
class MyNotificationReceivedListener: NotificationReceivedListener { private val TAG = "NotificationLogger" override onNotificationReceived(context: Context?, bundle: Bundle) { if(bundle.containsKey("special_price")) { Log.i(TAG, "Sale Notification received") } } }
Add your implementation using Marigold.addNotificationReceivedListener
<pre> ``` ... val marigold = Marigold() marigold.startEngine(getApplicationContext(), "your sdk key") marigold.addNotificationReceivedListener(MyNotificationReceivedListener()) ... ```
-
-
Method Summary
Modifier and Type Method Description abstract Unit
onNotificationReceived(Context context, Bundle bundle)
Called when the notification is receivedNote: You should not try to load/save data to Marigold directly from this method -
-
Method Detail
-
onNotificationReceived
abstract Unit onNotificationReceived(Context context, Bundle bundle)
Called when the notification is received
Note: You should not try to load/save data to Marigold directly from this method
- Parameters:
bundle
- notification data
-
-
-
-