-
public interface INotificationServiceExtensionImplement this interface on a class with a default public constructor and provide class with namespace as a value to a new
meta-datatag with the key name of "com.onesignal.NotificationServiceExtension" in your AndroidManifest.xml.ex. <meta-data android:name="com.onesignal.NotificationServiceExtension" android:value="com.company.MyNotificationExtensionService"></meta-data>
Because it is defined in the Android Manifest, it will receive control regardless of the current state of the application when the notification is received (foreground, background, not open).
-
-
Method Summary
Modifier and Type Method Description abstract UnitonNotificationReceived(INotificationReceivedEvent event)Called when a notification has been received by the device. -
-
Method Detail
-
onNotificationReceived
abstract Unit onNotificationReceived(INotificationReceivedEvent event)
Called when a notification has been received by the device. This method gives the implementor the ability to modify or prevent the notification from displaying to the user entirely.
- Parameters:
event- The notification received event information.
-
-
-
-