From 6ff0424032ebde7578bebdb75369fae97546504d Mon Sep 17 00:00:00 2001 From: yogevbd Date: Tue, 9 Jul 2019 17:57:14 +0300 Subject: [PATCH] Fix payload --- RNNotifications/RCTConvert+Notifications.m | 2 +- lib/src/index.ios.js | 14 +------------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/RNNotifications/RCTConvert+Notifications.m b/RNNotifications/RCTConvert+Notifications.m index d74a592..3129d42 100644 --- a/RNNotifications/RCTConvert+Notifications.m +++ b/RNNotifications/RCTConvert+Notifications.m @@ -117,7 +117,7 @@ RCT_ENUM_CONVERTER(UIUserNotificationActivationMode, (@{ formattedNotification[@"body"] = RCTNullIfNil(content.body); formattedNotification[@"category"] = RCTNullIfNil(content.categoryIdentifier); formattedNotification[@"thread"] = RCTNullIfNil(content.threadIdentifier); - formattedNotification[@"userInfo"] = RCTNullIfNil(RCTJSONClean(content.userInfo)); + [formattedNotification addEntriesFromDictionary:RCTNullIfNil(RCTJSONClean(content.userInfo))]; return formattedNotification; } diff --git a/lib/src/index.ios.js b/lib/src/index.ios.js index 3e87af9..171222d 100644 --- a/lib/src/index.ios.js +++ b/lib/src/index.ios.js @@ -84,7 +84,7 @@ export default class NotificationsIOS { } else if (type === DEVICE_NOTIFICATION_OPENED_EVENT) { listener = DeviceEventEmitter.addListener( type, - ({payload, identifier, action}) => handler(new IOSNotification(payload), () => { + (payload, identifier, action) => handler(new IOSNotification(payload), () => { NativeRNNotifications.finishHandlingAction(identifier); }, action) ); @@ -114,18 +114,6 @@ export default class NotificationsIOS { } } - static _actionHandlerDispatcher(action: Object) { - const actionHandler = _actionHandlers.get(action.identifier); - - if (actionHandler) { - action.notification = new IOSNotification(action.notification); - - actionHandler(action, () => { - NativeRNNotifications.finishHandlingAction(action.identifier); - }); - } - } - /** * Sets the notification categories */ -- 2.26.2