diff --git a/RNNotifications/RNNotifications.m b/RNNotifications/RNNotifications.m index cafa406e9dd54c05a5bbc9ea827c03cdaec72174..f74840d85be87fb8732c008e271a3a4dc081fe66 100644 --- a/RNNotifications/RNNotifications.m +++ b/RNNotifications/RNNotifications.m @@ -247,9 +247,11 @@ RCT_EXPORT_MODULE() NSMutableDictionary* info = [[NSMutableDictionary alloc] initWithDictionary:@{ @"identifier": identifier, @"completionKey": completionKey }]; // add text - NSString* text = ((UNTextInputNotificationResponse*)response).userText;//[response objectForKey:UIUserNotificationActionResponseTypedTextKey]; - if (text != NULL) { - info[@"text"] = text; + if ([response isKindOfClass:[UNTextInputNotificationResponse class]]) { + NSString* text = ((UNTextInputNotificationResponse*)response).userText; + if (text != NULL) { + info[@"text"] = text; + } } NSDictionary* userInfo = response.notification.request.content.userInfo;