Skip to content

Commit

Permalink
add changes for next version (#133)
Browse files Browse the repository at this point in the history
Co-authored-by: Mateus Andrade <[email protected]>
Co-authored-by: Lukas Baranauskas <[email protected]>
  • Loading branch information
3 people authored Jun 8, 2020
1 parent 0dd51f1 commit aac425b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -75,6 +75,7 @@ Then, add the 'UNUserNotificationCenterDelegate' to protocols:
At the top of the file:
```objective-c
#import <UserNotifications/UserNotifications.h>
#import <RNCPushNotificationIOS.h>
```

Expand Down Expand Up @@ -118,12 +119,6 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response

```

Also, if not already present, at the top of the file:

```objective-c
#import <UserNotifications/UserNotifications.h>
```

And then in your AppDelegate implementation, add the following:

```objective-c
Expand Down
1 change: 0 additions & 1 deletion example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export const App = () => {
const sendLocalNotification = () => {
PushNotificationIOS.presentLocalNotification({
alertBody: 'Sample local notification',
fireDate: new Date().toISOString(),
applicationIconBadgeNumber: 1,
});
};
Expand Down
2 changes: 2 additions & 0 deletions ios/RNCPushNotificationIOS.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit aac425b

Please sign in to comment.