Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit 2f3fac4

Browse files
author
Boris Tacyniak
authored
Merge pull request #1740 from jeremybarbet/master
docs: use package import
2 parents f74e38b + bc45aa5 commit 2f3fac4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public class MainApplication extends Application implements ReactApplication {
219219

220220
```javascript
221221
import PushNotificationIOS from "@react-native-community/push-notification-ios";
222-
var PushNotification = require("react-native-push-notification");
222+
import PushNotification from "react-native-push-notification";
223223

224224
// Must be outside of any component LifeCycle (such as `componentDidMount`).
225225
PushNotification.configure({
@@ -502,15 +502,15 @@ _NOTE: there is currently no api for removing specific notification alerts from
502502
### 3) removeAllDeliveredNotifications
503503

504504
```javascript
505-
PushNotificationIOS.removeAllDeliveredNotifications();
505+
PushNotification.removeAllDeliveredNotifications();
506506
```
507507

508508
Remove all delivered notifications from Notification Center
509509

510510
### 4) getDeliveredNotifications
511511

512512
```javascript
513-
PushNotificationIOS.getDeliveredNotifications(callback);
513+
PushNotification.getDeliveredNotifications(callback);
514514
```
515515

516516
Provides you with a list of the app’s notifications that are still displayed in Notification Center
@@ -533,7 +533,7 @@ A delivered notification is an object containing:
533533
### 5) removeDeliveredNotifications
534534

535535
```javascript
536-
PushNotificationIOS.removeDeliveredNotifications(identifiers);
536+
PushNotification.removeDeliveredNotifications(identifiers);
537537
```
538538

539539
Removes the specified notifications from Notification Center
@@ -547,7 +547,7 @@ Removes the specified notifications from Notification Center
547547
### 6) getScheduledLocalNotifications
548548

549549
```javascript
550-
PushNotificationIOS.getScheduledLocalNotifications(callback);
550+
PushNotification.getScheduledLocalNotifications(callback);
551551
```
552552

553553
Provides you with a list of the app’s scheduled local notifications that are yet to be displayed

0 commit comments

Comments
 (0)