File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ @implementation RNCPushNotificationIOS
260260}
261261
262262API_AVAILABLE (ios(10.0 ))
263- static NSDictionary *RCTFormatOpenedUNNotification(UNTextInputNotificationResponse *response)
263+ static NSDictionary *RCTFormatOpenedUNNotification(UNNotificationResponse *response)
264264{
265265 UNNotification * notification = response.notification ;
266266 NSMutableDictionary *formattedResponse = [RCTFormatUNNotification (notification) mutableCopy ];
@@ -269,10 +269,15 @@ @implementation RNCPushNotificationIOS
269269 NSMutableDictionary *userInfo = [content.userInfo mutableCopy ];
270270 userInfo[@" userInteraction" ] = [NSNumber numberWithInt: 1 ];
271271 userInfo[@" actionIdentifier" ] = response.actionIdentifier ;
272+
272273
273274 formattedResponse[@" userInfo" ] = RCTNullIfNil (RCTJSONClean (userInfo));
274275 formattedResponse[@" actionIdentifier" ] = RCTNullIfNil (response.actionIdentifier );
275- formattedResponse[@" userText" ] = RCTNullIfNil (response.userText );
276+
277+ NSString * userText = [response isKindOfClass: [UNTextInputNotificationResponse class ]] ? ((UNTextInputNotificationResponse *)response).userText : nil ;
278+ if (userText) {
279+ formattedResponse[@" userText" ] = RCTNullIfNil (userText);
280+ }
276281
277282 return formattedResponse;
278283}
You can’t perform that action at this time.
0 commit comments