OSNotification Payload
The OSNotification Class provides the Notification Payload data accessible within the SDK Notification Event Handlers. This class require the Major Release Versions of the OneSignal SDK.
OSNotification
Class
OSNotification
ClassThe OSNotification
class is composed of all getters. The class combines the original OSNotification
with data previously on the OSNotificationPayload
class into a single large OSNotification
class.
Type | Method/Property | Description |
---|---|---|
|
| Gets custom additional data that was sent with the notification. Set on the dashboard under Options > Additional Data or with the |
|
| Gets the unique Android Native API identifier. |
|
| Gets the OneSignal notification UUID. |
|
| Gets the body text of the notification. |
|
| Message Subtitle, iOS only. |
|
| Gets the title text of the notification. |
|
| Gets the URL opened when opening the notification. |
|
| Gets the large icon set on the notification. |
|
| Gets the big picture image set on the notification. iOS 10+ only. Attachments sent as part of the rich notification |
|
| Gets the small icon resource name set on the notification. |
|
| Gets the accent color shown around small notification icon on Android 5+ devices. ARGB format. |
|
| If a background image was set, this object will be available. The following methods on this object return strings:
|
|
| Get LED string. Devices that have a notification LED will blink in this color. ARGB format. |
|
| Gets the collapse id for the notfication. |
|
| The list of action buttons on the notification. The following methods on this object return strings:
|
|
| The priority of the notification. Values range from -2 to 2 (see Android's |
|
| Gets the Google project number the notification was sent under. |
|
| Gets the notification payloads a summary notification was created from. |
|
| Notifications with this same key will be grouped together as a single summary notification. |
|
| Gets the summary text displayed in the summary notification. |
|
| Privacy setting for how the notification should be shown on the lockscreen of Android 5+ devices.
|
|
| Gets the sound resource played when the notification is shown. Read more here |
|
| Unique Template Identifier from Templates. |
|
| Name of Template from Templates. |
|
| Extends Methods
|
|
| |
|
| Gets raw JSON payload string received from OneSignal. Holds the raw APS payload received. |
|
| iOS Notification category key previously registered to display with. |
|
| iOS 10+ only. Groups notifications into threads |
|
| True when the key content-available is set to 1 in the APNS payload. Used to wake your app when the payload is received. See Apple's documenation for more details. |
|
| True when the key mutable-content is set to 1 in the APNS payload. See Apple's documenation for more details. |
|
| The badge number assigned to the application icon. |
|
| The amount to increment the badge icon number. |
Method |
| Parses an APS push payload into a OSNotificationPayload object. Useful to call from your |
OSNotificationAction
Class
OSNotificationAction
ClassThe action the user took on the notification.
Type | Method | Description |
---|---|---|
|
| Notification button identifier |
|
| The action type. Enum:
|
Updated 6 months ago