From b3616cd45b685f01471741d65eb734cf50f6482a Mon Sep 17 00:00:00 2001 From: John Ryan Date: Wed, 28 Oct 2020 17:34:09 -0400 Subject: [PATCH] set userInteraction on initial notification Currrently userInteraction is false even though the app is started via tapping the notification to start the app. --- ios/RNCPushNotificationIOS.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ios/RNCPushNotificationIOS.m b/ios/RNCPushNotificationIOS.m index 4158117b6..3965c18c0 100644 --- a/ios/RNCPushNotificationIOS.m +++ b/ios/RNCPushNotificationIOS.m @@ -621,9 +621,15 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification self.bridge.launchOptions[UIApplicationLaunchOptionsLocalNotificationKey]; if (initialNotification) { + initialNotification[@"userInteraction"] = [NSNumber numberWithInt:1]; initialNotification[@"remote"] = @YES; resolve(initialNotification); } else if (initialLocalNotification) { + NSMutableDictionary *userInfo = [content.userInfo mutableCopy]; + NSMutableDictionary *localInfo = [initialLocalNotification.userInfo mutableCopy]; + localInfo[@"userInteraction"] = [NSNumber numberWithInt:1]; + initialLocalNotification.userInfo = localInfo; + initialLocalNotification[@"userInteraction"] = [NSNumber numberWithInt:1]; resolve(RCTFormatLocalNotification(initialLocalNotification)); } else { resolve((id)kCFNull);