Commit c6c4d0f3 authored by yogevbd's avatar yogevbd

Finish API documentation

parent b37ed53f
......@@ -20,6 +20,7 @@ lib/android/*.iml
lib/android/.idea
lib/android/build
lib/android/.gradle
*.gradle
#####
# OS X temporary files that should never be committed
......
......@@ -4,8 +4,8 @@ title: Android Specific Commands
sidebar_label: Android specific
---
## refreshToken
refreshToken
## refreshToken()
Request a new token for sending push notifications.
```js
Notifications.android.refreshToken();
......
---
id: doc2
title: document number 2
---
This is a link to [another document.](doc3.md)
This is a link to an [external page.](http://www.example.com)
---
id: doc3
title: This is document number 3
---
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In ac euismod odio, eu consequat dui. Nullam molestie consectetur risus id imperdiet. Proin sodales ornare turpis, non mollis massa ultricies id. Nam at nibh scelerisque, feugiat ante non, dapibus tortor. Vivamus volutpat diam quis tellus elementum bibendum. Praesent semper gravida velit quis aliquam. Etiam in cursus neque. Nam lectus ligula, malesuada et mauris a, bibendum faucibus mi. Phasellus ut interdum felis. Phasellus in odio pulvinar, porttitor urna eget, fringilla lectus. Aliquam sollicitudin est eros. Mauris consectetur quam vitae mauris interdum hendrerit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Duis et egestas libero, imperdiet faucibus ipsum. Sed posuere eget urna vel feugiat. Vivamus a arcu sagittis, fermentum urna dapibus, congue lectus. Fusce vulputate porttitor nisl, ac cursus elit volutpat vitae. Nullam vitae ipsum egestas, convallis quam non, porta nibh. Morbi gravida erat nec neque bibendum, eu pellentesque velit posuere. Fusce aliquam erat eu massa eleifend tristique.
Sed consequat sollicitudin ipsum eget tempus. Integer a aliquet velit. In justo nibh, pellentesque non suscipit eget, gravida vel lacus. Donec odio ante, malesuada in massa quis, pharetra tristique ligula. Donec eros est, tristique eget finibus quis, semper non nisl. Vivamus et elit nec enim ornare placerat. Sed posuere odio a elit cursus sagittis.
Phasellus feugiat purus eu tortor ultrices finibus. Ut libero nibh, lobortis et libero nec, dapibus posuere eros. Sed sagittis euismod justo at consectetur. Nulla finibus libero placerat, cursus sapien at, eleifend ligula. Vivamus elit nisl, hendrerit ac nibh eu, ultrices tempus dui. Nam tellus neque, commodo non rhoncus eu, gravida in risus. Nullam id iaculis tortor.
Nullam at odio in sem varius tempor sit amet vel lorem. Etiam eu hendrerit nisl. Fusce nibh mauris, vulputate sit amet ex vitae, congue rhoncus nisl. Sed eget tellus purus. Nullam tempus commodo erat ut tristique. Cras accumsan massa sit amet justo consequat eleifend. Integer scelerisque vitae tellus id consectetur.
---
id: doc4
title: Other Document
---
this is another document
---
id: doc5
title: Fifth Document
---
Another one
......@@ -4,8 +4,16 @@ title: General Commands
sidebar_label: General
---
## getInitialNotification
Return the notification that caused the app to launch from dead state.
## registerRemoteNotifications()
Requests remote notification permissions, prompting the user's dialog box on iOS and request a token on Android.
If the user accept the remote notifications permissions, `RemoteNotificationsRegistered` event will get called with the device token.
```js
Notifications.registerRemoteNotifications();
```
## getInitialNotification()
This method returns a promise. If the app was launched by a push notification, this promise resolves to an object of type Notification. Otherwise, it resolves to undefined.
```js
const notification: Notification = await Notifications.getInitialNotification();
......
......@@ -4,8 +4,8 @@ title: General
sidebar_label: General
---
## registerRemoteNotificationsRegistered
registerRemoteNotificationsRegistered
## registerRemoteNotificationsRegistered()
Fired when the user registers for remote notifications. The handler will be invoked with an event holding the hex string representing the `deviceToken`
```js
Notifications.events().registerRemoteNotificationsRegistered((event: Registered) => {
......@@ -13,8 +13,9 @@ Notifications.events().registerRemoteNotificationsRegistered((event: Registered)
});
```
## registerNotificationReceived
registerNotificationReceived
## registerNotificationReceived()
Fired when a remote notification is received in foreground state. The handler will be invoked with an instance of `Notification`.
Should call completion function on iOS, will be ignored on Android.
```js
Notifications.events().registerNotificationReceived((notification: Notification, completion: (response: NotificationCompletion) => void) => {
......@@ -25,20 +26,22 @@ Notifications.events().registerNotificationReceived((notification: Notification,
});
```
## registerRemoteNotificationOpened
registerRemoteNotificationOpened
## registerRemoteNotificationOpened()
Fired when a remote notification is opened from dead or background state. The handler will be invoked with an instance of `Notification`.
Should call completion function on iOS, will be ignored on Android.
```js
Notifications.events().registerRemoteNotificationOpened((notification: Notification) => {
Notifications.events().registerRemoteNotificationOpened((notification: Notification, completion: () => void) => {
console.log(JSON.stringify(notification.data));
completion();
});
```
## registerRemoteNotificationsRegistrationFailed
registerRemoteNotificationsRegistrationFailed
## registerRemoteNotificationsRegistrationFailed()
Fired when the user fails to register for remote notifications. Typically occurs when APNS is having issues, or the device is a simulator. The handler will be invoked with {localizedDescription: string, code: string, domain: string}.
```js
Notifications.events().registerRemoteNotificationsRegistrationFailed(() => {
Notifications.events().registerRemoteNotificationsRegistrationFailed((event: RegistrationError) => {
console.log(event.code, event.localizedDescription, event.domain);
});
```
\ No newline at end of file
......@@ -4,71 +4,73 @@ title: iOS Specific Commands
sidebar_label: iOS specific
---
## requestPermissions
request permissions
## requestPermissions()
Requests notification permissions from iOS, prompting the user's dialog box.
```js
Notifications.ios.requestPermissions();
```
## checkPermissions
checkPermissions
## checkPermissions()
See what push permissions are currently enabled.
```js
Notifications.ios.checkPermissions();
```
## abandonPermissions
Unregister for all remote notifications received via Apple Push Notification service
## 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
registerPushKit
## registerPushKit()
Register for PushKit notifications
```js
Notifications.ios.registerPushKit();
```
## cancelAllLocalNotifications
cancelAllLocalNotifications
## cancelAllLocalNotifications()
Cancels all scheduled localNotifications
```js
Notifications.ios.cancelAllLocalNotifications();
```
## getDeliveredNotifications
getDeliveredNotifications
## getDeliveredNotifications()
Provides you with a list of the app’s notifications that are still displayed in Notification Center
```js
Notifications.ios.getDeliveredNotifications();
```
## removeAllDeliveredNotifications
removeAllDeliveredNotifications
## removeAllDeliveredNotifications()
Remove all delivered notifications from Notification Center
```js
Notifications.ios.removeAllDeliveredNotifications();
```
## removeDeliveredNotifications
removeDeliveredNotifications
## removeDeliveredNotifications()
Removes the specified notifications from Notification Center
```js
Notifications.ios.removeDeliveredNotifications();
Notifications.ios.removeDeliveredNotifications(identifiers);
```
## getBadgeCount
getBadgeCount
## getBadgeCount()
Gets the badge count number from the aps object
```js
Notifications.ios.getBadgeCount();
```
## setBadgeCount
setBadgeCount
## setBadgeCount()
Sets the badge number for the app icon on the home screen
```js
Notifications.ios.setBadgeCount(1);
......
......@@ -4,8 +4,8 @@ title: iOS
sidebar_label: iOS specific
---
## registerPushKitRegistered
registerPushKitRegistered
## registerPushKitRegistered()
Fired when the user registers for PushKit notifications. The handler will be invoked with an event holding the hex string representing the `pushKitToken`
```js
Notifications.events().registerPushKitRegistered((event: RegisteredPushKit) => {
......@@ -13,8 +13,8 @@ Notifications.events().registerPushKitRegistered((event: RegisteredPushKit) => {
});
```
## registerPushKitNotificationReceived
registerPushKitNotificationReceived
## registerPushKitNotificationReceived()
Fired when a PushKit notification is received. The handler will be invoked with the notification object.
```js
Notifications.events().registerPushKitNotificationReceived((event: object) => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment