From 9cbc67cda563489b52d67cc6c8646edea197513f Mon Sep 17 00:00:00 2001 From: miteshsavani Date: Sat, 21 Oct 2023 15:06:45 +0530 Subject: [PATCH] fix(ios): callback not called when foreground is true #101 (#102) --- src/ios/AppDelegate+notification.m | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ios/AppDelegate+notification.m b/src/ios/AppDelegate+notification.m index b04c47687..895b93cbd 100644 --- a/src/ios/AppDelegate+notification.m +++ b/src/ios/AppDelegate+notification.m @@ -223,7 +223,14 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center case UIApplicationStateInactive: { NSLog(@"coldstart"); - self.launchNotification = response.notification.request.content.userInfo; + + if([response.actionIdentifier rangeOfString:@"UNNotificationDefaultActionIdentifier"].location == NSNotFound) { + self.launchNotification = userInfo; + } + else { + self.launchNotification = response.notification.request.content.userInfo; + } + self.coldstart = [NSNumber numberWithBool:YES]; break; }