From aac425bdf85fbc471ffd282b212c387c798301f7 Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Mon, 8 Jun 2020 20:32:17 +0900 Subject: [PATCH] add changes for next version (#133) Co-authored-by: Mateus Andrade Co-authored-by: Lukas Baranauskas <46403446+lukebars@users.noreply.github.com> --- README.md | 9 ++------- example/App.js | 1 - ios/RNCPushNotificationIOS.m | 2 ++ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 61e9801ab..bd318be61 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ There are a couple of cases for linking. Choose the appropriate one. The package is [automatically linked](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md) when building the app. All you need to do is: ```bash -cd ios && pod install +npx pod-install ``` - `react-native <= 0.59` @@ -75,6 +75,7 @@ Then, add the 'UNUserNotificationCenterDelegate' to protocols: At the top of the file: ```objective-c +#import #import ``` @@ -118,12 +119,6 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response ``` -Also, if not already present, at the top of the file: - -```objective-c -#import -``` - And then in your AppDelegate implementation, add the following: ```objective-c diff --git a/example/App.js b/example/App.js index 1f9e05d56..5f342a078 100644 --- a/example/App.js +++ b/example/App.js @@ -86,7 +86,6 @@ export const App = () => { const sendLocalNotification = () => { PushNotificationIOS.presentLocalNotification({ alertBody: 'Sample local notification', - fireDate: new Date().toISOString(), applicationIconBadgeNumber: 1, }); }; diff --git a/ios/RNCPushNotificationIOS.m b/ios/RNCPushNotificationIOS.m index 77f1b004d..97e28b6e3 100644 --- a/ios/RNCPushNotificationIOS.m +++ b/ios/RNCPushNotificationIOS.m @@ -92,9 +92,11 @@ @implementation RNCPushNotificationIOS formattedLocalNotification[@"fireDate"] = fireDateString; } formattedLocalNotification[@"alertAction"] = RCTNullIfNil(notification.alertAction); + formattedLocalNotification[@"alertTitle"] = RCTNullIfNil(notification.alertTitle); formattedLocalNotification[@"alertBody"] = RCTNullIfNil(notification.alertBody); formattedLocalNotification[@"applicationIconBadgeNumber"] = @(notification.applicationIconBadgeNumber); formattedLocalNotification[@"category"] = RCTNullIfNil(notification.category); + formattedLocalNotification[@"repeatInterval"] = RCTNullIfNil(notification.repeatInterval); formattedLocalNotification[@"soundName"] = RCTNullIfNil(notification.soundName); formattedLocalNotification[@"userInfo"] = RCTNullIfNil(RCTJSONClean(notification.userInfo)); formattedLocalNotification[@"remote"] = @NO;