Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3183002
D9248.id31322.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9248.id31322.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
@@ -59,20 +59,31 @@
// Step 1: notification decryption.
if ([self shouldBeDecrypted:content.userInfo]) {
+ std::optional<std::string> notifID;
+ NSString *objcNotifID = content.userInfo[@"id"];
+ if (objcNotifID) {
+ notifID = std::string([objcNotifID UTF8String]);
+ }
+
std::string decryptErrorMessage;
- std::string notifID = std::string([content.userInfo[@"id"] UTF8String]);
try {
@try {
[self decryptContentInPlace:content];
} @catch (NSException *e) {
decryptErrorMessage = "NSE: Received Obj-C exception: " +
std::string([e.name UTF8String]) +
- " during notification decryption. Notif ID: " + notifID;
+ " during notification decryption.";
+ if (notifID.has_value()) {
+ decryptErrorMessage += " Notif ID: " + notifID.value();
+ }
}
} catch (const std::exception &e) {
decryptErrorMessage =
"NSE: Received C++ exception: " + std::string(e.what()) +
- " during notification decryption. Notif ID: " + notifID;
+ " during notification decryption.";
+ if (notifID.has_value()) {
+ decryptErrorMessage += " Notif ID: " + notifID.value();
+ }
}
if (decryptErrorMessage.size()) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 8:18 AM (19 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2450802
Default Alt Text
D9248.id31322.diff (1 KB)
Attached To
Mode
D9248: [native] Fix rescinds and badge-only notifs on iOS
Attached
Detach File
Event Timeline
Log In to Comment