diff --git a/ios/RNCPushNotificationIOS.m b/ios/RNCPushNotificationIOS.m index 89adf61d9..962d19a57 100644 --- a/ios/RNCPushNotificationIOS.m +++ b/ios/RNCPushNotificationIOS.m @@ -371,7 +371,14 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification initialNotification[@"remote"] = @YES; resolve(initialNotification); } else if (initialLocalNotification) { - resolve([RCTConvert RCTFormatLocalNotification:initialLocalNotification]); + NSMutableDictionary *formattedInitialLocalNotification = [[RCTConvert RCTFormatLocalNotification:initialLocalNotification] mutableCopy]; + if ([formattedInitialLocalNotification objectForKey:@"userInfo"] == nil) { + formattedInitialLocalNotification[@"userInfo"] = [NSMutableDictionary dictionary]; + } else { + formattedInitialLocalNotification[@"userInfo"] = [formattedInitialLocalNotification[@"userInfo"] mutableCopy] + } + formattedInitialLocalNotification[@"userInfo"][@"userInteraction"] = [NSNumber numberWithInt:1]; + resolve(formattedInitialLocalNotification); } else { resolve((id)kCFNull); }