Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
05c3a49
Add support for notification alert title on iOS
Dec 18, 2017
896cf18
Remove note about local notification title for iOS
Dec 18, 2017
acfd079
Support local notifications on Android O
gustavogenovese Feb 22, 2018
7f0344b
Merge pull request #613 from damir-sirola/patch-1
zo0r Mar 7, 2018
b547502
Add googlePlayServicesVersion
superandrew213 Mar 21, 2018
ab45996
Update readme
superandrew213 Mar 21, 2018
a27b482
Update readme
superandrew213 Mar 21, 2018
bf2eb11
Add more configuration properties
superandrew213 Mar 27, 2018
7d8f298
Update readme
superandrew213 Mar 27, 2018
b7befef
Merge pull request #684 from superandrew213/add-gradle-configuration-…
zo0r Mar 27, 2018
5b34f15
Update package.json
zo0r Mar 27, 2018
47118fe
Merge remote-tracking branch 'zo0r/master'
superandrew213 Apr 10, 2018
0c8f29b
Remove default message
superandrew213 Apr 10, 2018
3e5ca20
Add clearLocalNotification method
FlorianGerhardt Apr 12, 2018
88f7f3e
Update info on repeating notifications
abarisic86 Apr 19, 2018
5afd96c
add `checkPermissions` for Android
riwu Apr 20, 2018
6f11b92
Clarifying usage for `cancelLocalNotifications`
omerman Apr 20, 2018
555ba35
Copy `twi_body` to `message` to support Twilio.
peterp May 17, 2018
4ea649c
Update README.md
May 25, 2018
30fee7b
Update README.md
jerameel Jun 7, 2018
24e7782
Update description of localNotificationSchedule
viniciuspalma Jun 8, 2018
8a090f0
Merge branch 'master' into master
Gp2mv3 Jul 4, 2018
924fbbc
Merge pull request #657 from gcesarmza/master
Gp2mv3 Jul 4, 2018
741ca71
Merge pull request #755 from Jerameel/patch-1
Gp2mv3 Jul 4, 2018
cf03860
Merge pull request #757 from viniciuspalma/patch-1
Gp2mv3 Jul 4, 2018
cab502c
Merge pull request #722 from omerman/patch-1
Gp2mv3 Jul 4, 2018
a80272d
Merge pull request #719 from abarisic86/master
Gp2mv3 Jul 4, 2018
0bcc9ac
Merge pull request #711 from bluebird-tech/clearNotification
Gp2mv3 Jul 4, 2018
2281819
Merge pull request #707 from superandrew213/android-remove-alert-trig…
Gp2mv3 Jul 4, 2018
c65762a
Revert changes in build.gradle (Bad merge from PR)
Gp2mv3 Jul 5, 2018
a00f3c5
Created Example app (Does nothing currently)
Gp2mv3 Jul 5, 2018
72aa374
Merge pull request #721 from riwu/master
Gp2mv3 Jul 5, 2018
a913f84
Add Firebase support
Apr 17, 2018
2befc73
Add missing import (FirebaseMessaging)
Apr 17, 2018
9ebe403
Make subscribeToTopic accessible
Apr 17, 2018
91d8c2e
Merge branch 'master' of https://github.com/zo0r/react-native-push-no…
Gp2mv3 Jul 13, 2018
05c5f3c
Merge pull request #747 from richardkarsten/patch-1
Gp2mv3 Jul 14, 2018
28d368a
First example app (Only on Android, tested only in emulator)
Gp2mv3 Jul 15, 2018
4370945
Removed example app from npm package
Gp2mv3 Jul 15, 2018
c925dd9
Merge branch 'master' into example-app
Gp2mv3 Jul 16, 2018
bb2e464
Corrected babelrc for react-native
Gp2mv3 Jul 16, 2018
1455d0c
Changed Display Name of app
Gp2mv3 Jul 16, 2018
00ddc39
Different notifications for scheduled and instantaneous notif
Gp2mv3 Jul 16, 2018
8308e13
Begin of work on Remote push notifications testing
Gp2mv3 Jul 16, 2018
5318359
Merge pull request #744 from chatterbugapp/pp-support-twilio-message
Gp2mv3 Jul 17, 2018
44cb230
Merge pull request #717 from avencat/feature/firebase
Gp2mv3 Jul 17, 2018
41d42a0
Merge branch 'master' into example-app
Gp2mv3 Jul 23, 2018
5b53901
Remote notifications now work
Gp2mv3 Jul 23, 2018
d5afc87
Example app is added in Readme
Gp2mv3 Jul 23, 2018
1c6d7b0
Update to v3.1.1
Gp2mv3 Jul 23, 2018
7562679
Merge branch 'example-app'
Gp2mv3 Jul 23, 2018
dd8b140
Added Changelor in Readme
Gp2mv3 Jul 23, 2018
6be5ed4
Corrected changelog links
Gp2mv3 Jul 23, 2018
0d19d1f
Added lokg of token (to copy/past easily from Android log)
Gp2mv3 Jul 23, 2018
e6de911
PR links in changelog
Gp2mv3 Jul 23, 2018
9cf51a5
Typo fixes
elitree Jul 23, 2018
d22e07c
:bug: Fix title and message in bundle
steelbrain Jul 31, 2018
1510612
:bug: Fix pop initial for firebase
steelbrain Jul 31, 2018
a071458
Merge pull request #802 from elitree/master
Gp2mv3 Jul 31, 2018
150efb0
:bug: Add a null-check around remote message
steelbrain Aug 1, 2018
b61ce08
Merge pull request #807 from Truebill/fix-pop-initial
Gp2mv3 Aug 1, 2018
ccd9edc
Merge pull request #806 from Truebill/steelbrain/fix-title-message
Gp2mv3 Aug 1, 2018
a529d01
Fix requestPermission crash
Gp2mv3 Aug 1, 2018
2c4fcc9
Add import for symbol Log
lsirdevan Aug 2, 2018
143289c
update README about localNotificationSchedule()
brownmagik352 Aug 6, 2018
b0bb4a6
:new: Use some config parameters from the manifest
steelbrain Aug 8, 2018
bc8e24f
:memo: Document usage in README
steelbrain Aug 8, 2018
4843b39
:racehorse: Cache metadata
steelbrain Aug 8, 2018
de426bb
:art: Minor lifecycle simplification
steelbrain Aug 8, 2018
882653d
:new: Also read notification color from config
steelbrain Aug 8, 2018
1169bfe
:bug: Convert resource id to color id
steelbrain Aug 8, 2018
51f55e7
:art: Change error log to warning
steelbrain Aug 8, 2018
beedb16
Merge pull request #816 from brownmagik352/patch-1
Gp2mv3 Aug 10, 2018
dc03edc
Merge pull request #811 from logan1220/sdk26
Gp2mv3 Aug 10, 2018
feada0c
Merge pull request #809 from zo0r/sdk26
Gp2mv3 Aug 10, 2018
eec2c3e
updated sdk and build tool version on gradle to solve error “Cannot …
Aug 13, 2018
6d51072
Standardize Changelog
rodrigobdz Aug 16, 2018
8718e61
Merge pull request #826 from receme/master
Gp2mv3 Aug 20, 2018
f7b4759
Merge pull request #822 from Truebill/channel-config-rev2
Gp2mv3 Aug 20, 2018
a95af74
Merge pull request #831 from rodrigobdz/patch-1
Gp2mv3 Aug 20, 2018
aa2e894
Updated Readme for meta-data in Android Manifest
Gp2mv3 Aug 21, 2018
975198c
Updated Example app for metadata in AndroidManifest
Gp2mv3 Aug 21, 2018
6b73262
Actions now open the app: Fix #783
Gp2mv3 Aug 21, 2018
fe4ba12
Added the "old" GCM listener to get compatibility with GCM back
Gp2mv3 Aug 21, 2018
0f25d9e
react-native link react-native-push-notification
lfkwtz Aug 22, 2018
9708445
Merge pull request #839 from lfkwtz/patch-1
Gp2mv3 Aug 27, 2018
5f63c66
[Android] Allow to set notification priority
lorenc-tomasz Aug 29, 2018
0b9ca84
[Android] Allow to set notification visibility option
lorenc-tomasz Aug 29, 2018
a8fc763
[Android] Allow to set notification importance option
lorenc-tomasz Aug 29, 2018
b1bd556
Update README.md
lorenc-tomasz Aug 29, 2018
f885bb5
Uppdate README.md
lorenc-tomasz Aug 29, 2018
b482ab7
Fix typos in README.md
lorenc-tomasz Aug 29, 2018
7b7e18b
[Android] Fix typos; Change NotificationCompat type to int where it w…
lorenc-tomasz Aug 31, 2018
8254425
Added category to localNotificationSchedule payload
Gp2mv3 Sep 6, 2018
3bd0b6f
Merge pull request #835 from zo0r/fixGcm
Gp2mv3 Sep 6, 2018
aaf2d19
Merge pull request #854 from lorenc-tomasz/Android_Change_Priority
Gp2mv3 Sep 6, 2018
83dc15d
Fix example app cancel notification
Sep 13, 2018
5f9ff91
Update doc to avoid falling Androids build
danibonilha Sep 21, 2018
fc5c722
Merge pull request #879 from danibonilha/patch-1
Gp2mv3 Oct 8, 2018
1143632
Merge pull request #869 from hshiraiwa/fix/example-app-cancel-notific…
Gp2mv3 Oct 8, 2018
c0b9a2a
add a changelog for 3.1.2
CapitanRedBeard Oct 17, 2018
13f741e
Merge pull request #906 from CapitanRedBeard/task/changelog-3.1.2
Gp2mv3 Oct 17, 2018
ae4f9fd
Version bump: 3.1.2
Gp2mv3 Oct 17, 2018
ea0b877
Adding support of custom icon in notification and updating payload
24ark Dec 12, 2017
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
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ react-native-notifications.iml
.idea
.gradle
local.properties

# Example app
example
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [3.1.2] - 2018-10-16

## Added
- Allow to set notification's priority, visibility and importance options on Android, [@lorenc-tomasz](https://github.com/lorenc-tomasz) `aaf2d19` [#854](https://github.com/zo0r/react-native-push-notification/pull/854)
- Added the "old" GCM listener to get compatibility with GCM back, [@zo0r](https://github.com/zo0r) `3bd0b6f` [#835](https://github.com/zo0r/react-native-push-notification/pull/835)
- Allow configuring notification channel and color through manifest, [@Truebill](https://github.com/Truebill) `f7b4759` [#822](https://github.com/zo0r/react-native-push-notification/pull/822)

## Fixed
- Fix example app cancel notification, [@hshiraiwa](https://github.com/danibonilha) `1143632` [#869](https://github.com/zo0r/react-native-push-notification/pull/869)
- Update documentation to avoid falling Androids' build, [@danibonilha](https://github.com/danibonilha) `fc5c722` [#879](https://github.com/zo0r/react-native-push-notification/pull/879)
- Fix react-native link command, [@lfkwtz](https://github.com/lfkwtz) `9708445` [#839](https://github.com/zo0r/react-native-push-notification/pull/839)
- Standardize Changelog, [@rodrigobdz](https://github.com/rodrigobdz) `a95af74` [#831](https://github.com/zo0r/react-native-push-notification/pull/831)
- Updated sdk and build tool version on gradle file, [@receme](https://github.com/receme) `8718e61` [#826](https://github.com/zo0r/react-native-push-notification/pull/826)
- Fix requestPermissions crash, [@zo0r](https://github.com/zo0r) `feada0c` [#809](https://github.com/zo0r/react-native-push-notification/pull/809)
- Readme clarification on localNotificationSchedule(), [@brownmagik352](https://github.com/brownmagik352) `beedb16` [#816](https://github.com/zo0r/react-native-push-notification/pull/816)
- Fix title and message for Firebase, [@Truebill](https://github.com/Truebill) `ccd9edc` [#806](https://github.com/zo0r/react-native-push-notification/pull/806)
- Fix pop initial for firebase, [@Truebill](https://github.com/Truebill) `b61ce08` [#807](https://github.com/zo0r/react-native-push-notification/pull/807)
- Various readme typos, [@elitree](https://github.com/elitree) `a071458` [#802](https://github.com/zo0r/react-native-push-notification/pull/802)

## [3.1.1] - 2018-07-31

## Added
- Android Oreo support (SDK >= 26) (PR [#657](https://github.com/zo0r/react-native-push-notification/pull/657))
- Firebase (FCM) Support (PR [#717](https://github.com/zo0r/react-native-push-notification/pull/717))
- Twilio support (PR [#744](https://github.com/zo0r/react-native-push-notification/pull/744))
- clearLocalNotification (PR [#711](https://github.com/zo0r/react-native-push-notification/pull/711))

## Fixed
- checkPermissions (PR [#721](https://github.com/zo0r/react-native-push-notification/pull/721))
- Remove default alert for silent push (PR [#707](https://github.com/zo0r/react-native-push-notification/pull/707))

[Unreleased]: https://github.com/zo0r/react-native-push-notification/compare/v3.1.2...HEAD
[3.1.2]: https://github.com/zo0r/react-native-push-notification/compare/v3.1.1...v3.1.2
[3.1.1]: https://github.com/zo0r/react-native-push-notification/compare/...v3.1.1
174 changes: 146 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ React Native Local and Remote Notifications for iOS and Android
| **2.0.2** | **0.30, 0.31, 0.32** | [Open](https://github.com/zo0r/react-native-push-notification/blob/a0f7d44e904ba0b92933518e5bf6b444f1c90abb/README.md) |
| **>= 2.1.0** | **>= 0.33** | [Open](https://github.com/zo0r/react-native-push-notification/blob/a359e5c00954aa324136eaa9808333d6ca246171/README.md) |

## Changelog
Changelog is available from version 3.1.1 here: [Changelog](https://github.com/zo0r/react-native-push-notification/blob/master/CHANGELOG.md)

## Installation
`npm install --save react-native-push-notification`
`npm install --save react-native-push-notification` or `yarn add react-native-push-notification`

`react-native link`
`react-native link react-native-push-notification`

**NOTE: For Android, you will still have to manually update the AndroidManifest.xml (as below) in order to use Scheduled Notifications.**

Expand All @@ -36,32 +38,48 @@ The component uses PushNotificationIOS for the iOS part.

## Android manual Installation

**NOTE: To use a specific `play-service-gcm` version, use in your `android/app/build.gradle` (change `8.1.0` for your version):**
```gradle
...

dependencies {
...
**NOTE: `play-service-gcm` and `firebase-messaging`, prior to version 15 requires to have the same version number in order to work correctly at build time and at run time. To use a specific version:**

compile project(':react-native-push-notification')
compile ('com.google.android.gms:play-services-gcm:8.1.0') {
force = true;
}
In your `android/build.gradle`
```gradle
ext {
googlePlayServicesVersion = "<Your play services version>" // default: "+"
firebaseVersion = "<Your Firebase version>" // default: "+"

// Other settings
compileSdkVersion = <Your compile SDK version> // default: 23
buildToolsVersion = "<Your build tools version>" // default: "23.0.1"
targetSdkVersion = <Your target SDK version> // default: 23
supportLibVersion = "<Your support lib version>" // default: 23.1.1
}
```

**NOTE: localNotification() works without changes in the application part, while localNotificationSchedule() only works with these changes:**

In your `AndroidManifest.xml`
```xml
.....
<!-- < Only if you're using GCM or localNotificationSchedule() > -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission
android:name="${applicationId}.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
<!-- < Only if you're using GCM or localNotificationSchedule() > -->

<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>

<application ....>
<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_name"
android:value="YOUR NOTIFICATION CHANNEL NAME"/>
<meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_description"
android:value="YOUR NOTIFICATION CHANNEL DESCRIPTION"/>
<!-- Change the resource name to your App's accent color - or any other color you want -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_color"
android:resource="@android:color/white"/>

<!-- < Only if you're using GCM or localNotificationSchedule() > -->
<receiver
android:name="com.google.android.gms.gcm.GcmReceiver"
android:exported="true"
Expand All @@ -71,6 +89,7 @@ In your `AndroidManifest.xml`
<category android:name="${applicationId}" />
</intent-filter>
</receiver>
<!-- < Only if you're using GCM or localNotificationSchedule() > -->

<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
Expand All @@ -79,25 +98,44 @@ In your `AndroidManifest.xml`
</intent-filter>
</receiver>
<service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationRegistrationService"/>

<!-- < Only if you're using GCM or localNotificationSchedule() > -->
<service
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerServiceGcm"
android:exported="false" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
</intent-filter>
</service>
<!-- </ Only if you're using GCM or localNotificationSchedule() > -->

<!-- < Else > -->
<service
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
android:exported="false" >
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- </Else> -->
.....

```

In `android/settings.gradle`
```gradle
...

include ':react-native-push-notification'
project(':react-native-push-notification').projectDir = file('../node_modules/react-native-push-notification/android')
```

In `android/app/src/res/values/colors.xml` (Create the file if it doesn't exist).
```xml
<resources>
<color name="white">#FFF</color>
</resources>
```

Manually register module in `MainApplication.java` (if you did not use `react-native link`):

```java
Expand Down Expand Up @@ -141,13 +179,13 @@ PushNotification.configure({
console.log( 'NOTIFICATION:', notification );

// process the notification

// required on iOS only (see fetchCompletionHandler docs: https://facebook.github.io/react-native/docs/pushnotificationios.html)
notification.finish(PushNotificationIOS.FetchResult.NoData);
},

// ANDROID ONLY: GCM Sender ID (optional - not required for local notifications, but is need to receive remote push notifications)
senderID: "YOUR GCM SENDER ID",
// ANDROID ONLY: GCM or FCM Sender ID (product_number) (optional - not required for local notifications, but is need to receive remote push notifications)
senderID: "YOUR GCM (OR FCM) SENDER ID",

// IOS ONLY (optional): default: all - Permissions to register.
permissions: {
Expand All @@ -169,6 +207,12 @@ PushNotification.configure({
});
```

## Example app
Example folder contains an example app to demonstrate how to use this package. The notification Handling is done in `NotifService.js`. For Remote notifications, configure your SenderId in `app.json`. You can also edit it directly in the app.
To send Push notifications, you can use the online tool [PushWatch](https://www.pushwatch.com/gcm/).

Please test your PRs with this example app before submitting them. It'll help maintaining this repo.

## Handling Notifications
When any notification is opened or received the callback `onNotification` is called passing an object with the notification data.

Expand Down Expand Up @@ -202,19 +246,22 @@ PushNotification.localNotification({
tag: 'some_tag', // (optional) add tag to message
group: "group", // (optional) add group to message
ongoing: false, // (optional) set whether this is an "ongoing" notification
priority: "high", // (optional) set notification priority, default: high
visibility: "private", // (optional) set notification visibility, default: private
importance: "high", // (optional) set notification importance, default: high

/* iOS only properties */
alertAction: // (optional) default: view
category: // (optional) default: null
userInfo: // (optional) default: null (object containing additional notification data)

/* iOS and Android properties */
title: "My Notification Title", // (optional, for iOS this is only used in apple watch, the title will be the app name on other iOS devices)
title: "My Notification Title", // (optional)
message: "My Notification Message", // (required)
playSound: false, // (optional) default: true
soundName: 'default', // (optional) Sound to play when the notification is shown. Value of 'default' plays the default sound. It can be set to a custom sound such as 'android.resource://com.xyz/raw/my_sound'. It will look for the 'my_sound' audio file in 'res/raw' directory and play it. default: 'default' (default sound is played)
number: '10', // (optional) Valid 32 bit integer specified as string. default: none (Cannot be zero)
repeatType: 'day', // (Android only) Repeating interval. Could be one of `week`, `day`, `hour`, `minute, `time`. If specified as time, it should be accompanied by one more parameter 'repeatTime` which should the number of milliseconds between each interval
repeatType: 'day', // (optional) Repeating interval. Check 'Repeating Notifications' section for more info.
actions: '["Yes", "No"]', // (Android only) See the doc for notification actions to know more
});
```
Expand All @@ -225,6 +272,7 @@ PushNotification.localNotification({
EXAMPLE:
```javascript
PushNotification.localNotificationSchedule({
//... You can use all the options from localNotifications
message: "My Notification Message", // (required)
date: new Date(Date.now() + (60 * 1000)) // in 60 secs
});
Expand All @@ -244,16 +292,75 @@ In the location notification json specify the full file name:

### 1) cancelLocalNotifications

`PushNotification.cancelLocalNotifications(details);`
#### Android
The `id` parameter for `PushNotification.localNotification` is required for this operation. The id supplied will then be used for the cancel operation.

```javascript
// Android
PushNotification.localNotification({
...
id: '123'
...
});
PushNotification.cancelLocalNotifications({id: '123'});
```


## Notification priority ##

(optional) Specify `priority` to set priority of notification. Default value: "high"

Available options:

"max" = NotficationCompat.PRIORITY_MAX
"high" = NotficationCompat.PRIORITY_HIGH
"low" = NotficationCompat.PRIORITY_LOW
"min" = NotficationCompat.PRIORITY_MIN
"default" = NotficationCompat.PRIORITY_DEFAULT

More information: https://developer.android.com/reference/android/app/Notification.html#PRIORITY_DEFAULT

## Notification visibility ##

(optional) Specify `visibility` to set visibility of notification. Default value: "private"

Available options:

"private" = NotficationCompat.VISIBILITY_PRIVATE
"public" = NotficationCompat.VISIBILITY_PUBLIC
"secret" = NotficationCompat.VISIBILITY_SECRET

More information: https://developer.android.com/reference/android/app/Notification.html#VISIBILITY_PRIVATE

## Notification importance ##

The the `details` parameter allows you to specify a `userInfo` dictionary that can be used to match one or more *scheduled* notifications. Each
matched notification is cancelled and its alerts removed from the notification centre. The RN docs suggest this is an optional parameter, but
it is not.
(optional) Specify `importance` to set importance of notification. Default value: "high"

Available options:

"default" = NotificationManager.IMPORTANCE_DEFAULT
"max" = NotificationManager.IMPORTANCE_MAX
"high" = NotificationManager.IMPORTANCE_HIGH
"low" = NotificationManager.IMPORTANCE_LOW
"min" = NotificationManager.IMPORTANCE_MIN
"none" = NotificationManager.IMPORTANCE_NONE
"unspecified" = NotificationManager.IMPORTANCE_UNSPECIFIED

More information: https://developer.android.com/reference/android/app/NotificationManager#IMPORTANCE_DEFAULT

#### IOS
The `userInfo` parameter for `PushNotification.localNotification` is required for this operation and must contain an `id` parameter. The id supplied will then be used for the cancel operation.
```javascript
// IOS
PushNotification.localNotification({
...
userInfo: { id: '123' }
...
});
PushNotification.cancelLocalNotifications({id: '123'});
```


### 2) cancelAllLocalNotifications

`PushNotification.cancelAllLocalNotifications()`
Expand All @@ -264,9 +371,9 @@ Cancels all scheduled notifications AND clears the notifications alerts that are

## Repeating Notifications ##

(Android only) Specify `repeatType` and optionally `repeatTime` while scheduling the local notification. Check the local notification example above.
(optional) Specify `repeatType` and optionally `repeatTime` while scheduling the local notification. Check the local notification example above.

For iOS, the repeating notification should land soon. It has already been merged to the [master](https://github.com/facebook/react-native/pull/10337)
Property `repeatType` could be one of `week`, `day`, `hour`, `minute`, `time`. If specified as time, it should be accompanied by one more parameter `repeatTime` which should the number of milliseconds between each interval.

## Notification Actions ##

Expand All @@ -275,7 +382,7 @@ For iOS, the repeating notification should land soon. It has already been merged
Two things are required to setup notification actions.

### 1) Specify notification actions for a notification
This is done by specifying an `actions` parameters while configuring the local notification. This is an array of strings where each string is a notificaiton action that will be presented with the notification.
This is done by specifying an `actions` parameters while configuring the local notification. This is an array of strings where each string is a notification action that will be presented with the notification.

For e.g. `actions: '["Accept", "Reject"]' // Must be in string format`

Expand Down Expand Up @@ -316,9 +423,20 @@ Uses the [ShortcutBadger](https://github.com/leolin310148/ShortcutBadger) on And
## Sending Notification Data From Server
Same parameters as `PushNotification.localNotification()`

## iOS Only Methods
## Android Only Methods

`PushNotification.subscribeToTopic(topic: string)` Subscribe to a topic (works only with Firebase)

## Checking Notification Permissions
`PushNotification.checkPermissions(callback: Function)` Check permissions

`PushNotification.getApplicationIconBadgeNumber(callback: Function)` get badge number
`callback` will be invoked with a `permissions` object:
- `alert`: boolean
- `badge`: boolean
- `sound`: boolean

## iOS Only Methods

`PushNotification.getApplicationIconBadgeNumber(callback: Function)` Get badge number

`PushNotification.abandonPermissions()` Abandon permissions
Loading