mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
resolve getInitialNotification with userInfo dict instead of whole notification
Summary: Changelog: [Internal] `getInitialNotification` only expect the user info dictionary of the dictionary, not the complete formatted notification. Reviewed By: cipolleschi Differential Revision: D53691569 fbshipit-source-id: 9a24629d2e50544c55ea5cd16097bd88dad950ec
This commit is contained in:
committed by
Facebook GitHub Bot
parent
19012ca9ee
commit
59c5edfe63
@@ -535,12 +535,13 @@ RCT_EXPORT_METHOD(getInitialNotification
|
||||
if (self.initialNotification) {
|
||||
NSDictionary<NSString *, id> *notificationDict =
|
||||
RCTFormatUNNotificationContent(self.initialNotification.request.content);
|
||||
NSDictionary *userInfo = notificationDict[@"userInfo"];
|
||||
if (IsNotificationRemote(self.initialNotification)) {
|
||||
NSMutableDictionary<NSString *, id> *notificationDictCopy = [notificationDict mutableCopy];
|
||||
notificationDictCopy[@"remote"] = @YES;
|
||||
resolve(notificationDictCopy);
|
||||
NSMutableDictionary<NSString *, id> *userInfoCopy = [userInfo mutableCopy];
|
||||
userInfoCopy[@"remote"] = @YES;
|
||||
resolve(userInfoCopy);
|
||||
} else {
|
||||
resolve(notificationDict);
|
||||
resolve(userInfo);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user