Create and update dynamic, real-time notifications on Android devices using OneSignal Live Notifications. Deliver continuously updated content inside a single notification, simulating iOS Live Activities for Android.
collapse_id
.
NotificationServiceExtension
class that implements INotificationServiceExtension
. This class intercepts incoming notifications and can modify or override them.
key
, which determines how updates are routed.
additional_data
field to pass structured content.
Property | Required | Description |
---|---|---|
key | Yes | Used to load the correct notification UI. |
event | Yes | The action to perform on the Live Notification. |
event_attributes | No | Static data is used to initialize the Live Notification; a Self-defined schema that defines the data your notification needs. |
event_updates | No | Dynamic content of the Live Notification. Must conform to the ContentState interface defined within your app’s Live Notification. |
Event | Description | Required fields |
---|---|---|
start | Begins a Live Notification with static and dynamic data. | event_attributes , event_updates |
update | Updates the Live Notification with new dynamic data. | event_updates |
end | Ends and removes the Live Notification. | None |
event_attributes
to initialize the static data for the Live Notification. This data will not change during the lifetime of the Live Notification.event_updates
data to initialize the dynamic data for the Live Notification. This is the data that can and will change during the lifetime of the Live Notification.collapse_id
to make sure each update overrides the previous. This ID should be unique to the Live Notification to ensure subsequent updates are reflected in the same notification.event_updates
data to initialize the dynamic data for the Live Notification. This is the data that can and will change during the lifetime of the Live Notification and informs what to update your Live Notification’s content with.