ios-api.md 1.81 KB
Newer Older
yogevbd's avatar
yogevbd committed
1 2
---
id: ios-api
yogevbd's avatar
yogevbd committed
3
title: iOS Specific Commands
yogevbd's avatar
yogevbd committed
4 5 6
sidebar_label: iOS specific
---

yogevbd's avatar
yogevbd committed
7 8
## requestPermissions()
Requests notification permissions from iOS, prompting the user's dialog box.
yogevbd's avatar
yogevbd committed
9

yogevbd's avatar
yogevbd committed
10
```js
11
Notifications.ios.requestPermissions();
yogevbd's avatar
yogevbd committed
12
```
yogevbd's avatar
yogevbd committed
13

yogevbd's avatar
yogevbd committed
14 15
## checkPermissions()
See what push permissions are currently enabled.
yogevbd's avatar
yogevbd committed
16

yogevbd's avatar
yogevbd committed
17
```js
18 19 20
Notifications.ios.checkPermissions();
```

yogevbd's avatar
yogevbd committed
21 22 23 24
## 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.
25 26 27

```js
Notifications.ios.abandonPermissions();
yogevbd's avatar
yogevbd committed
28
```
yogevbd's avatar
yogevbd committed
29

yogevbd's avatar
yogevbd committed
30 31
## registerPushKit()
Register for PushKit notifications
yogevbd's avatar
yogevbd committed
32 33

```js
34
Notifications.ios.registerPushKit();
yogevbd's avatar
yogevbd committed
35 36
```

yogevbd's avatar
yogevbd committed
37 38
## cancelAllLocalNotifications()
Cancels all scheduled localNotifications
yogevbd's avatar
yogevbd committed
39 40

```js
41
Notifications.ios.cancelAllLocalNotifications();
yogevbd's avatar
yogevbd committed
42 43
```

yogevbd's avatar
yogevbd committed
44 45
## getDeliveredNotifications()
Provides you with a list of the app’s notifications that are still displayed in Notification Center
yogevbd's avatar
yogevbd committed
46 47

```js
48
Notifications.ios.getDeliveredNotifications();
yogevbd's avatar
yogevbd committed
49 50
```

yogevbd's avatar
yogevbd committed
51 52
## removeAllDeliveredNotifications()
Remove all delivered notifications from Notification Center
yogevbd's avatar
yogevbd committed
53 54

```js
55
Notifications.ios.removeAllDeliveredNotifications();
yogevbd's avatar
yogevbd committed
56 57
```

yogevbd's avatar
yogevbd committed
58 59
## removeDeliveredNotifications()
Removes the specified notifications from Notification Center
yogevbd's avatar
yogevbd committed
60 61

```js
yogevbd's avatar
yogevbd committed
62
Notifications.ios.removeDeliveredNotifications(identifiers);
yogevbd's avatar
yogevbd committed
63 64
```

yogevbd's avatar
yogevbd committed
65 66
## getBadgeCount()
Gets the badge count number from the aps object
yogevbd's avatar
yogevbd committed
67 68

```js
69
Notifications.ios.getBadgeCount();
yogevbd's avatar
yogevbd committed
70 71
```

yogevbd's avatar
yogevbd committed
72 73
## setBadgeCount()
Sets the badge number for the app icon on the home screen
yogevbd's avatar
yogevbd committed
74 75

```js
76
Notifications.ios.setBadgeCount(1);
yogevbd's avatar
yogevbd committed
77
```