From 65d5f5168bd444d5708b1ceb809fa2a0d710d6fe Mon Sep 17 00:00:00 2001 From: st1ng Date: Thu, 3 Dec 2020 18:14:39 +0400 Subject: [PATCH] Set userInteraction for initialLocalNotification Previously it was correctly set for "remove" notifications, but was not set for local ones, and this way "initialnotification" were never treated as "opened by user" --- ios/RNCPushNotificationIOS.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ios/RNCPushNotificationIOS.m b/ios/RNCPushNotificationIOS.m index 3f8ab9ef5..8aeb08b97 100644 --- a/ios/RNCPushNotificationIOS.m +++ b/ios/RNCPushNotificationIOS.m @@ -630,6 +630,9 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification initialNotification[@"remote"] = @YES; resolve(initialNotification); } else if (initialLocalNotification) { + NSMutableDictionary *userInfo = [[initialLocalNotification userInfo] mutableCopy]; + userInfo[@"userInteraction"] = [NSNumber numberWithInt:1]; + [initialLocalNotification setUserInfo:userInfo]; resolve(RCTFormatLocalNotification(initialLocalNotification)); } else { resolve((id)kCFNull);