Files
react-native-notifications/docs/ios-api.md
2019-10-02 13:44:37 +03:00

77 lines
1.8 KiB
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
id: ios-api
title: iOS Specific Commands
sidebar_label: iOS specific
---
## requestPermissions()
Requests notification permissions from iOS, prompting the user's dialog box.
```js
Notifications.ios.requestPermissions();
```
## checkPermissions()
See what push permissions are currently enabled.
```js
Notifications.ios.checkPermissions();
```
## abandonPermissions()
Unregister for all remote notifications received via Apple Push Notification service.
You should call this method in rare circumstances only, such as when a new version of the app removes support for all types of remote notifications. Users can temporarily prevent apps from receiving remote notifications through the Notifications section of the Settings app. Apps unregistered through this method can always re-register.
```js
Notifications.ios.abandonPermissions();
```
## registerPushKit()
Register for PushKit notifications
```js
Notifications.ios.registerPushKit();
```
## cancelAllLocalNotifications()
Cancels all scheduled localNotifications
```js
Notifications.ios.cancelAllLocalNotifications();
```
## getDeliveredNotifications()
Provides you with a list of the apps notifications that are still displayed in Notification Center
```js
Notifications.ios.getDeliveredNotifications();
```
## removeAllDeliveredNotifications()
Remove all delivered notifications from Notification Center
```js
Notifications.ios.removeAllDeliveredNotifications();
```
## removeDeliveredNotifications()
Removes the specified notifications from Notification Center
```js
Notifications.ios.removeDeliveredNotifications(identifiers);
```
## getBadgeCount()
Gets the badge count number from the aps object
```js
Notifications.ios.getBadgeCount();
```
## setBadgeCount()
Sets the badge number for the app icon on the home screen
```js
Notifications.ios.setBadgeCount(1);
```