Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32790495
D9429.1768002579.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D9429.1768002579.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
Fri, Jan 9, 11:49 PM (6 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5911718
Default Alt Text
D9429.1768002579.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