File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,20 @@ @implementation RNCPushNotificationIOS
125
125
return formattedNotification;
126
126
}
127
127
128
+ API_AVAILABLE (ios(10.0 ))
129
+ static NSDictionary *RCTFormatOpenedUNNotification(UNNotification *notification)
130
+ {
131
+ NSMutableDictionary *formattedNotification = [RCTFormatUNNotification (notification) mutableCopy ];
132
+ UNNotificationContent *content = notification.request .content ;
133
+
134
+ NSMutableDictionary *userInfo = [content.userInfo mutableCopy ];
135
+ userInfo[@" userInteraction" ] = @" 1" ;
136
+
137
+ formattedNotification[@" userInfo" ] = RCTNullIfNil (RCTJSONClean (userInfo));
138
+
139
+ return formattedNotification;
140
+ }
141
+
128
142
#endif // TARGET_OS_TV / TARGET_OS_UIKITFORMAC
129
143
130
144
RCT_EXPORT_MODULE ()
@@ -220,7 +234,7 @@ + (void)didReceiveNotificationResponse:(UNNotificationResponse *)response
220
234
API_AVAILABLE(ios(10.0 )) {
221
235
[[NSNotificationCenter defaultCenter ] postNotificationName: kLocalNotificationReceived
222
236
object: self
223
- userInfo: RCTFormatUNNotification (response.notification)];
237
+ userInfo: RCTFormatOpenedUNNotification (response.notification)];
224
238
}
225
239
226
240
- (void )handleLocalNotificationReceived : (NSNotification *)notification
You can’t perform that action at this time.
0 commit comments