diff --git a/index.d.ts b/index.d.ts index 67427049..3a6cf429 100644 --- a/index.d.ts +++ b/index.d.ts @@ -127,6 +127,11 @@ export interface PushNotification { */ getUserText(): string | undefined; + /** + * Gets the complete notification payload including aps and all custom fields + */ + getFullPayload(): Record; + /** * iOS Only * Signifies remote notification handling is complete diff --git a/js/index.js b/js/index.js index b2cd9502..ad786aff 100644 --- a/js/index.js +++ b/js/index.js @@ -464,6 +464,7 @@ class PushNotificationIOS { */ constructor(nativeNotif: Object) { this._data = {}; + this._fullPayload = nativeNotif; // Store the complete payload this._remoteNotificationCompleteCallbackCalled = false; this._isRemote = nativeNotif.remote; if (this._isRemote) { @@ -643,6 +644,13 @@ class PushNotificationIOS { getUserText(): ?string { return this._userText; } + + /** + * Gets the complete notification payload including aps and all custom fields + */ + getFullPayload(): ?Object { + return this._fullPayload; + } } export default PushNotificationIOS;