Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3365142
D9429.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D9429.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 26, 6:46 AM (20 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2583332
Default Alt Text
D9429.diff (2 KB)
Attached To
Mode
D9429: Send all notifications received by backgrounded app to JS at once
Attached
Detach File
Event Timeline
Log In to Comment