From 5d15b59559a0225141c4dfbf31134cb6ada338f2 Mon Sep 17 00:00:00 2001 From: sergeysozinov Date: Tue, 28 May 2024 10:12:40 +0300 Subject: [PATCH] MBX-3383: fix getting url from button for old notification format --- ios/MindboxJsDelivery.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ios/MindboxJsDelivery.m b/ios/MindboxJsDelivery.m index 4f8b104..15c3171 100644 --- a/ios/MindboxJsDelivery.m +++ b/ios/MindboxJsDelivery.m @@ -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"];