Skip to content

Commit

Permalink
MBX-3383: fix getting url from button for old notification format
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeysozinov committed May 28, 2024
1 parent 3628606 commit 5d15b59
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ios/MindboxJsDelivery.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ - (void)emitEventInternal:(NSNotification *)notification {
clickUrl = [filteredArray.firstObject objectForKey:@"url"];
}

if ([clickUrl length] == 0) {
NSDictionary *aps = [userInfo objectForKey:@"aps"];
NSArray *apsButtons = [aps objectForKey:@"buttons"];
filteredArray = [apsButtons filteredArrayUsingPredicate:predicate];
if (filteredArray.count > 0) {
clickUrl = [filteredArray.firstObject objectForKey:@"url"];
}
}

pushPayload = [userInfo objectForKey:@"payload"];
if ([pushPayload length] == 0) {
NSDictionary *aps = [userInfo objectForKey:@"aps"];
Expand Down

0 comments on commit 5d15b59

Please sign in to comment.