From 323b73f864e32460be4d196fed7b4c578825638d Mon Sep 17 00:00:00 2001 From: Nathan Bolender Date: Sun, 22 Nov 2020 02:32:44 -0500 Subject: [PATCH] Add badge and sound to UNNotification and UNNotificationRequest formatters (#237) --- ios/RNCPushNotificationIOS.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ios/RNCPushNotificationIOS.m b/ios/RNCPushNotificationIOS.m index cd405bfe8..3f8ab9ef5 100644 --- a/ios/RNCPushNotificationIOS.m +++ b/ios/RNCPushNotificationIOS.m @@ -233,6 +233,8 @@ @implementation RNCPushNotificationIOS formattedNotification[@"title"] = RCTNullIfNil(content.title); formattedNotification[@"subtitle"] = RCTNullIfNil(content.subtitle); formattedNotification[@"body"] = RCTNullIfNil(content.body); + formattedNotification[@"badge"] = RCTNullIfNil(content.badge); + formattedNotification[@"sound"] = RCTNullIfNil(content.sound); formattedNotification[@"category"] = RCTNullIfNil(content.categoryIdentifier); formattedNotification[@"thread-id"] = RCTNullIfNil(content.threadIdentifier); formattedNotification[@"userInfo"] = RCTNullIfNil(RCTJSONClean(content.userInfo)); @@ -250,6 +252,8 @@ @implementation RNCPushNotificationIOS formattedRequest[@"title"] = RCTNullIfNil(content.title); formattedRequest[@"subtitle"] = RCTNullIfNil(content.subtitle); formattedRequest[@"body"] = RCTNullIfNil(content.body); + formattedRequest[@"badge"] = RCTNullIfNil(content.badge); + formattedRequest[@"sound"] = RCTNullIfNil(content.sound); formattedRequest[@"category"] = RCTNullIfNil(content.categoryIdentifier); formattedRequest[@"thread-id"] = RCTNullIfNil(content.threadIdentifier); formattedRequest[@"userInfo"] = RCTNullIfNil(RCTJSONClean(content.userInfo));