Page MenuHomePhabricator

D9429.diff
No OneTemporary

D9429.diff

diff --git a/native/ios/Comm/AppDelegate.mm b/native/ios/Comm/AppDelegate.mm
--- a/native/ios/Comm/AppDelegate.mm
+++ b/native/ios/Comm/AppDelegate.mm
@@ -337,11 +337,13 @@
TemporaryMessageStorage *temporaryStorage =
[[TemporaryMessageStorage alloc] init];
NSArray<NSString *> *messages = [temporaryStorage readAndClearMessages];
+
+ if (sendBackgroundMessagesInfosToJS && messages && messages.count) {
+ [CommIOSNotifications
+ didReceiveBackgroundMessageInfos:@{@"messageInfosArray" : messages}];
+ }
+
for (NSString *message in messages) {
- if (sendBackgroundMessagesInfosToJS) {
- [CommIOSNotifications
- didReceiveBackgroundMessageInfos:@{@"messageInfos" : message}];
- }
std::string messageInfos = std::string([message UTF8String]);
comm::GlobalDBSingleton::instance.scheduleOrRun([messageInfos]() mutable {
comm::MessageOperationsUtilities::storeMessageInfos(messageInfos);
diff --git a/native/push/ios.js b/native/push/ios.js
--- a/native/push/ios.js
+++ b/native/push/ios.js
@@ -81,7 +81,9 @@
remoteNotificationsRegistrationFailed: [void],
notificationReceivedForeground: [CoreIOSNotificationData],
notificationOpened: [CoreIOSNotificationData],
- notificationReceivedBackground: [{ +messageInfos: ?string }],
+ notificationReceivedBackground: [
+ { +messageInfosArray: $ReadOnlyArray<string> },
+ ],
}>,
> {
return new NativeEventEmitter(CommIOSNotifications);
diff --git a/native/push/push-handler.react.js b/native/push/push-handler.react.js
--- a/native/push/push-handler.react.js
+++ b/native/push/push-handler.react.js
@@ -540,11 +540,11 @@
};
iosBackgroundNotificationReceived = backgroundData => {
- const convertedMessageInfos = convertNotificationMessageInfoToNewIDSchema(
- backgroundData.messageInfos,
- );
+ const convertedMessageInfos = backgroundData.messageInfosArray
+ .flatMap(convertNotificationMessageInfoToNewIDSchema)
+ .filter(Boolean);
- if (!convertedMessageInfos) {
+ if (!convertedMessageInfos.length) {
return;
}

File Metadata

Mime Type
text/plain
Expires
Sat, Sep 21, 3:53 AM (20 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2157462
Default Alt Text
D9429.diff (2 KB)

Event Timeline