Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33313049
D9600.1768817317.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D9600.1768817317.diff
View Options
diff --git a/native/ios/NotificationService/NotificationService.mm b/native/ios/NotificationService/NotificationService.mm
--- a/native/ios/NotificationService/NotificationService.mm
+++ b/native/ios/NotificationService/NotificationService.mm
@@ -196,7 +196,7 @@
// Step 5: (optional) create empty notification that
// only provides badge count.
- if ([self isBadgeOnly:content.userInfo]) {
+ if ([self needsSilentBadgeUpdate:content.userInfo]) {
UNMutableNotificationContent *badgeOnlyContent =
[[UNMutableNotificationContent alloc] init];
badgeOnlyContent.badge = content.badge;
@@ -309,7 +309,7 @@
// At this point we know that the content is at least
// correctly decrypted so we can display it to the user.
// Another operation, like persistence, had failed.
- if ([self isBadgeOnly:content.userInfo]) {
+ if ([self needsSilentBadgeUpdate:content.userInfo]) {
UNNotificationContent *badgeOnlyContent =
[self getBadgeOnlyContentFor:content];
handler(badgeOnlyContent);
@@ -431,10 +431,19 @@
[payload[backgroundNotificationTypeKey] isEqualToString:@"CLEAR"];
}
-- (BOOL)isBadgeOnly:(NSDictionary *)payload {
+- (BOOL)needsSilentBadgeUpdate:(NSDictionary *)payload {
// TODO: refactor this check by introducing
// badgeOnly property in iOS notification payload
- return !payload[@"threadID"];
+ if (!payload[@"threadID"]) {
+ // This notif only contains a badge update. We could let it go through
+ // normally, but for internal builds we set the BODY to "ENCRYPTED" for
+ // debugging purposes. So instead of letting the badge-only notif go
+ // through, we construct another notif that doesn't have a body.
+ return true;
+ }
+ // If the notif is a rescind, then we'll filter it out. So we need another
+ // notif to update the badge count.
+ return [self isRescind:payload];
}
- (BOOL)isCollapsible:(NSDictionary *)payload {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 19, 10:08 AM (17 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5955194
Default Alt Text
D9600.1768817317.diff (1 KB)
Attached To
Mode
D9600: [native] Update iOS badge for rescinds
Attached
Detach File
Event Timeline
Log In to Comment