From 3f2060fbd6c8c3ddb06e4e491a8753862914889b Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 16 Feb 2023 16:29:52 -0500 Subject: [PATCH] [User Model] Expose `INotification.rawPayload` --- .../main/java/com/onesignal/notifications/INotification.kt | 6 ++++++ .../com/onesignal/notifications/internal/Notification.kt | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/notifications/INotification.kt b/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/notifications/INotification.kt index 3b5d83b45d..973e0d95e1 100644 --- a/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/notifications/INotification.kt +++ b/OneSignalSDK/onesignal/core/src/main/java/com/onesignal/notifications/INotification.kt @@ -132,6 +132,12 @@ interface INotification { */ val groupedNotifications: List? + /** + * The raw payload of the notification that can into the device. This should only be used to + * access any data that is not yet represented in a property. + */ + val rawPayload: String? + /** * Create a mutable copy of this notification. Typically used in [IRemoteNotificationReceivedHandler] * or [INotificationWillShowInForegroundHandler] to modify an incoming notification prior to it diff --git a/OneSignalSDK/onesignal/notifications/src/main/java/com/onesignal/notifications/internal/Notification.kt b/OneSignalSDK/onesignal/notifications/src/main/java/com/onesignal/notifications/internal/Notification.kt index 0fbe8d85a9..1157455b43 100644 --- a/OneSignalSDK/onesignal/notifications/src/main/java/com/onesignal/notifications/internal/Notification.kt +++ b/OneSignalSDK/onesignal/notifications/src/main/java/com/onesignal/notifications/internal/Notification.kt @@ -51,7 +51,7 @@ open class Notification : INotification { override var sentTime: Long = 0 override var ttl = 0 - var rawPayload: String? = null + override var rawPayload: String? = null constructor() {} constructor(payload: JSONObject, time: ITime) : this(null, payload, 0, time) {}