Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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