Skip to content

Commit

Permalink
fix(iOS): foreground notifications linking (/w images) (#11416)
Browse files Browse the repository at this point in the history
fix: foreground notifications linking (/w images)

Co-authored-by: brainbicycle <brian.beckerle@artsymail.com>
Co-authored-by: Sultan Al-Maari <sltun2oo9@gmail.com>
  • Loading branch information
3 people authored Jan 21, 2025
1 parent 1621e2e commit e22305e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ios/Artsy/App/ARAppNotificationsDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,17 @@ -(void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNoti
// Handle the tapping on the notification when the app in the foreground
-(void)userNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler{
BOOL processedByBraze = ARAppDelegate.braze != nil && [ARAppDelegate.braze.notifications handleUserNotificationWithResponse:response
withCompletionHandler:completionHandler];
withCompletionHandler:completionHandler];

NSDictionary *userInfo = response.notification.request.content.userInfo;
NSMutableDictionary *notificationInfo = [[NSMutableDictionary alloc] initWithDictionary:userInfo];

if (processedByBraze) {
NSString *url = userInfo[@"ab_uri"];
[self tappedNotification:userInfo url:url];
return;
}

NSDictionary *userInfo = response.notification.request.content.userInfo;
NSMutableDictionary *notificationInfo = [[NSMutableDictionary alloc] initWithDictionary:userInfo];

[self tappedNotification:notificationInfo url:userInfo[@"url"]];
completionHandler();
Expand Down

0 comments on commit e22305e

Please sign in to comment.