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:
Phillip Pan
2024-02-13 08:32:47 -08:00
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;
}