{"_id":"@alexdrimbe/react-native-push-notification","_rev":"2-3548cb95a55c276da86a4593b7918ada","name":"@alexdrimbe/react-native-push-notification","dist-tags":{"latest":"3.1.5"},"versions":{"3.1.4":{"name":"@alexdrimbe/react-native-push-notification","version":"3.1.4","description":"React Native Local and Remote Notifications","main":"index","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["react-component","react-native","ios","android","notifications","push","apns","gcm"],"bugs":{"url":"https://github.com/zo0r/react-native-push-notification/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/zo0r/react-native-push-notification.git"},"peerDependencies":{"react-native":">=0.33"},"rnpm":{"android":{"packageInstance":"new ReactNativePushNotificationPackage()"}},"author":{"name":"zo0r","email":"http://zo0r.me"},"license":"MIT","gitHead":"8fa9b34b8372bd6e7ced603a8b3dcfa9e5ea0554","homepage":"https://github.com/zo0r/react-native-push-notification#readme","_id":"@alexdrimbe/react-native-push-notification@3.1.4","_nodeVersion":"10.8.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-VKufdIFVaER+xeL1aqqTJEAkVc1kpmI8utve07M8sLDDSgZZ1kKD9TBhheguLPoZdJ+rLtac/DZHkS3FaWc3ow==","shasum":"e800510cbe8818b937a799a43340ec64b9790c97","tarball":"https://registry.npmjs.org/@alexdrimbe/react-native-push-notification/-/react-native-push-notification-3.1.4.tgz","fileCount":27,"unpackedSize":146441,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7Xt2CRA9TVsSAnZWagAARakP/37gYP3fHByRNHKFuPPr\nxo/j+VU82ztULPRloQdrDaBWO19YZrGKpJRHFyQtue4hoZss6HpU4ql56AD0\nAzrYLEDhCGCz8wLhz+MXqOehyb3mChhG10AbNxKYQGZasVQg0l3UBV/eqLuS\nOcsTuVoHvCqgOR0zLZYoNzolAFoQfRuuQxwWItE1fwf+nSj/eL3gaT7nqpX1\n6SaAOj0zdEbA3bV/Dg9vpZEUC+MPaw9SDJbKAnF4sVyaknHapctPQKrZBNvU\nh1UEmFkNNTm2tJwldudwI5tA3F3yXhXluh98ODI+jv5dB5MWkIzF7IweBq5B\n1XE1Nb2f9r73SRR0F+TPmIi5RdpV5A2T9Ofq4UIeHKxy+mET+o4SjkokUAuY\nEBN1XYq9oNu8D5rFcA9HgAM5VYxm5mEZZW41hUGTQd9wLjhPLl85ENGIphGz\nWR0A5HJ7oeUP1qEYTtUp2GHgF2ONBmiyS1ZjzdgT5n2vM/opQWdgL7v3SQUw\nILZV0Pm3l0eE5yuiRGNQZk8/YzUp45jOheOuFoXWmuVO4nRkL6XJM6uqzybv\nj5L/R+gI9gpjqSHvQg3HcNMLHklYlpV885CV5h1jwmi7FyVOVSoeagquVh3n\nKptGhSo8QbaSsEE12uGInMB2jBo9pE4SuG7RPtPU23GjGvoqiZFbZhYxDfEl\nil9E\r\n=wP21\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGIqMGrVaHaoM+pxyMXZbt6TKiGN32r9GnHt7FAOHZbLAiEAnv+FIBNhNx01at5mr0jrZpsxji5ybDzONInMzcAeO+Q="}]},"maintainers":[{"name":"alexdrimbe","email":"alexdrimbe@gmail.com"}],"_npmUser":{"name":"alexdrimbe","email":"alexdrimbe@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-push-notification_3.1.4_1559067510014_0.8426633334582292"},"_hasShrinkwrap":false},"3.1.5":{"name":"@alexdrimbe/react-native-push-notification","version":"3.1.5","description":"React Native Local and Remote Notifications","main":"index","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["react-component","react-native","ios","android","notifications","push","apns","gcm"],"bugs":{"url":"https://github.com/zo0r/react-native-push-notification/issues"},"repository":{"type":"git","url":"git+ssh://git@github.com/zo0r/react-native-push-notification.git"},"peerDependencies":{"react-native":">=0.33"},"rnpm":{"android":{"packageInstance":"new ReactNativePushNotificationPackage()"}},"author":{"name":"zo0r","email":"http://zo0r.me"},"license":"MIT","gitHead":"eb1c78a837b851fee19f8e2f46ba9fa9207e8f75","homepage":"https://github.com/zo0r/react-native-push-notification#readme","_id":"@alexdrimbe/react-native-push-notification@3.1.5","_nodeVersion":"10.8.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-4SzhldyF7bx93u9TczVhJLKbziTYyN+4Vdq2nnAUJ8HoC9nsts+d5VXUVLENTtrhlY3mQiTmbOydJp/KpwcFvg==","shasum":"551e374d2cd2b85ebe00752f282302695ea228e9","tarball":"https://registry.npmjs.org/@alexdrimbe/react-native-push-notification/-/react-native-push-notification-3.1.5.tgz","fileCount":26,"unpackedSize":135615,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc796MCRA9TVsSAnZWagAAyqgP/03q34FnXK35IGzt3NHI\nJl7kWGwcaT5+FGb6hpIYbv6GdKhIXl3ri6PT/cfNaPWbZMGH6qG6CCm+TVRm\nBqJsgvxh3vtY0iWTHUAVsdxBXtb/si+nnAmfvpw1JN1V4MOWPH6uWTpMxcGI\n45JLpNtpVVlStgEPDoVlUC7WT5TSilnhSwQJ/7gBxJaBaKB/3y4NRJ6wv9J4\n7Oi8WUHXQNnOaTL42fbqzPSr0mfhzBA7IL1l0CbkRLaKGmAbBg5pgVvzggcZ\nrKY+owFeQWDU5cMBP049HcvW//9L7RgFwZdpWQK7zvTXKRd/rBlD6gfsLkfM\nUAXffCXnCj/lVWxHbIYggVYXOY8cB4eIHbotWfty4ZNiwngSrucfe6OHCD47\nkFlxQUdnhp6VuNN955P7UzHb5hasUstUjVf2XbR8Y5xLJUL1ti9G//3rdCEz\nqPkuvoVxsLgVLJl0ffNA8jt1mA4eDR32HSPFxeTwQuWbHePUovXx1nvjEChR\nt654P+2NMwQhQd0iXEL/xx4PufkqhgWUs4CZ62FMZK6LVI2dpS7yXm8bznd/\nwj0w5HYDbI+c9FdQShPi9konsaw74/vRI0aV4NGTzomBDqHhdoZ6dhzY5smv\nY0XcvCQQ22WGh7dipu0VtCu+IXY1LX4a5nojGaHfePaxjhgBHFTbqa5c5LgP\n7q0G\r\n=2yRh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEqfuK7+y6tne7Gdrod9KLb/rRsdZ/usW432axeXZHyPAiBByuNg3bFM35Gr8wzKrI2qn6gjtLxhL8ShXGnJ1EuU6Q=="}]},"maintainers":[{"name":"alexdrimbe","email":"alexdrimbe@gmail.com"}],"_npmUser":{"name":"alexdrimbe","email":"alexdrimbe@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-push-notification_3.1.5_1559223947851_0.8690960553174802"},"_hasShrinkwrap":false}},"time":{"created":"2019-05-28T18:18:29.977Z","3.1.4":"2019-05-28T18:18:30.122Z","modified":"2022-04-04T12:39:39.382Z","3.1.5":"2019-05-30T13:45:47.998Z"},"maintainers":[{"name":"alexdrimbe","email":"alexdrimbe@gmail.com"}],"description":"React Native Local and Remote Notifications","homepage":"https://github.com/zo0r/react-native-push-notification#readme","keywords":["react-component","react-native","ios","android","notifications","push","apns","gcm"],"repository":{"type":"git","url":"git+ssh://git@github.com/zo0r/react-native-push-notification.git"},"author":{"name":"zo0r","email":"http://zo0r.me"},"bugs":{"url":"https://github.com/zo0r/react-native-push-notification/issues"},"license":"MIT","readme":"# React Native Push Notifications\n[![npm version](https://badge.fury.io/js/react-native-push-notification.svg?update=8)](http://badge.fury.io/js/react-native-push-notification)\n[![npm downloads](https://img.shields.io/npm/dm/react-native-push-notification.svg?update=8)](http://badge.fury.io/js/react-native-push-notification)\n\nReact Native Local and Remote Notifications for iOS and Android\n\n## Supported React Native Versions\n| Component Version     | RN Versions    | README     |\n|-----------------------|---------------|------------|\n| **1.0.7**          | **<= 0.27**   | [Open](https://github.com/zo0r/react-native-push-notification/blob/f42723817f1687e0da23e6753eb8a9f0385b6ac5/README.md)   |\n| **1.0.8**          | **0.28**   | [Open](https://github.com/zo0r/react-native-push-notification/blob/2eafd1961273ca6a82ad4dd6514fbf1d1a829089/README.md)   |\n| **2.0.1**          | **0.29**   | [Open](https://github.com/zo0r/react-native-push-notification/blob/c7ab7cd84ea19e42047379aefaf568bb16a81936/README.md)   |\n| **2.0.2**          | **0.30, 0.31, 0.32**   | [Open](https://github.com/zo0r/react-native-push-notification/blob/a0f7d44e904ba0b92933518e5bf6b444f1c90abb/README.md)   |\n| **>= 2.1.0**          | **>= 0.33**   | [Open](https://github.com/zo0r/react-native-push-notification/blob/a359e5c00954aa324136eaa9808333d6ca246171/README.md)   |\n\n## Changelog\nChangelog is available from version 3.1.1 here: [Changelog](https://github.com/zo0r/react-native-push-notification/blob/master/CHANGELOG.md)\n\n## Installation\n`npm install --save react-native-push-notification` or `yarn add react-native-push-notification`\n\n`react-native link react-native-push-notification`\n\n**NOTE: For Android, you will still have to manually update the AndroidManifest.xml (as below) in order to use Scheduled Notifications.**\n\n## Issues\n\nHaving a problem?  Read the [troubleshooting](./trouble-shooting.md) guide before raising an issue.\n\n## Pull Requests\n\n[Please read...](./submitting-a-pull-request.md)\n\n## iOS manual Installation\nThe component uses PushNotificationIOS for the iOS part.\n\n[Please see: PushNotificationIOS](https://facebook.github.io/react-native/docs/pushnotificationios.html#content)\n\n## Android manual Installation\n\n**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:**\n\nIn your `android/build.gradle`\n```gradle\next {\n    googlePlayServicesVersion = \"<Your play services version>\" // default: \"+\"\n    firebaseVersion = \"<Your Firebase version>\" // default: \"+\"\n\n    // Other settings\n    compileSdkVersion = <Your compile SDK version> // default: 23\n    buildToolsVersion = \"<Your build tools version>\" // default: \"23.0.1\"\n    targetSdkVersion = <Your target SDK version> // default: 23\n    supportLibVersion = \"<Your support lib version>\" // default: 23.1.1\n}\n```\n\n**NOTE: localNotification() works without changes in the application part, while localNotificationSchedule() only works with these changes:**\n\nIn your `AndroidManifest.xml`\n```xml\n    .....\n    <!-- < Only if you're using GCM or localNotificationSchedule() > -->\n    <uses-permission android:name=\"android.permission.WAKE_LOCK\" />\n    <permission\n        android:name=\"${applicationId}.permission.C2D_MESSAGE\"\n        android:protectionLevel=\"signature\" />\n    <uses-permission android:name=\"${applicationId}.permission.C2D_MESSAGE\" />\n    <!-- < Only if you're using GCM or localNotificationSchedule() > -->\n\n    <uses-permission android:name=\"android.permission.VIBRATE\" />\n    <uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\"/>\n\n    <application ....>\n        <meta-data  android:name=\"com.dieam.reactnativepushnotification.notification_channel_name\"\n                android:value=\"YOUR NOTIFICATION CHANNEL NAME\"/>\n        <meta-data  android:name=\"com.dieam.reactnativepushnotification.notification_channel_description\"\n                    android:value=\"YOUR NOTIFICATION CHANNEL DESCRIPTION\"/>\n        <!-- Change the resource name to your App's accent color - or any other color you want -->\n        <meta-data  android:name=\"com.dieam.reactnativepushnotification.notification_color\"\n                    android:resource=\"@android:color/white\"/>\n\n        <!-- < Only if you're using GCM or localNotificationSchedule() > -->\n        <receiver\n            android:name=\"com.google.android.gms.gcm.GcmReceiver\"\n            android:exported=\"true\"\n            android:permission=\"com.google.android.c2dm.permission.SEND\" >\n            <intent-filter>\n                <action android:name=\"com.google.android.c2dm.intent.RECEIVE\" />\n                <category android:name=\"${applicationId}\" />\n            </intent-filter>\n        </receiver>\n        <!-- < Only if you're using GCM or localNotificationSchedule() > -->\n\n        <receiver android:name=\"com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher\" />\n        <receiver android:name=\"com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.BOOT_COMPLETED\" />\n            </intent-filter>\n        </receiver>\n        <service android:name=\"com.dieam.reactnativepushnotification.modules.RNPushNotificationRegistrationService\"/>\n\n        <!-- < Only if you're using GCM or localNotificationSchedule() > -->\n        <service\n            android:name=\"com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerServiceGcm\"\n            android:exported=\"false\" >\n            <intent-filter>\n                <action android:name=\"com.google.android.c2dm.intent.RECEIVE\" />\n            </intent-filter>\n        </service>\n        <!-- </ Only if you're using GCM or localNotificationSchedule() > -->\n\n        <!-- < Else > -->\n        <service\n            android:name=\"com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService\"\n            android:exported=\"false\" >\n            <intent-filter>\n                <action android:name=\"com.google.firebase.MESSAGING_EVENT\" />\n            </intent-filter>\n        </service>\n        <!-- </Else> -->\n     .....\n\n```\n\nIn `android/settings.gradle`\n```gradle\n...\ninclude ':react-native-push-notification'\nproject(':react-native-push-notification').projectDir = file('../node_modules/react-native-push-notification/android')\n```\n\nIn `android/app/src/res/values/colors.xml` (Create the file if it doesn't exist).\n```xml\n<resources>\n    <color name=\"white\">#FFF</color>\n</resources>\n```\n\nManually register module in `MainApplication.java` (if you did not use `react-native link`):\n\n```java\nimport com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;  // <--- Import Package\n\npublic class MainApplication extends Application implements ReactApplication {\n\n  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {\n      @Override\n      protected boolean getUseDeveloperSupport() {\n        return BuildConfig.DEBUG;\n      }\n\n      @Override\n      protected List<ReactPackage> getPackages() {\n\n      return Arrays.<ReactPackage>asList(\n          new MainReactPackage(),\n          new ReactNativePushNotificationPackage() // <---- Add the Package\n      );\n    }\n  };\n\n  ....\n}\n```\n\n## Usage\n```javascript\nvar PushNotification = require('react-native-push-notification');\n\nPushNotification.configure({\n\n    // (optional) Called when Token is generated (iOS and Android)\n    onRegister: function(token) {\n        console.log( 'TOKEN:', token );\n    },\n\n    // (required) Called when a remote or local notification is opened or received\n    onNotification: function(notification) {\n        console.log( 'NOTIFICATION:', notification );\n\n        // process the notification\n\n        // required on iOS only (see fetchCompletionHandler docs: https://facebook.github.io/react-native/docs/pushnotificationios.html)\n        notification.finish(PushNotificationIOS.FetchResult.NoData);\n    },\n\n    // ANDROID ONLY: GCM or FCM Sender ID (product_number) (optional - not required for local notifications, but is need to receive remote push notifications)\n    senderID: \"YOUR GCM (OR FCM) SENDER ID\",\n\n    // IOS ONLY (optional): default: all - Permissions to register.\n    permissions: {\n        alert: true,\n        badge: true,\n        sound: true\n    },\n\n    // Should the initial notification be popped automatically\n    // default: true\n    popInitialNotification: true,\n\n    /**\n      * (optional) default: true\n      * - Specified if permissions (ios) and token (android and ios) will requested or not,\n      * - if not, you must call PushNotificationsHandler.requestPermissions() later\n      */\n    requestPermissions: true,\n});\n```\n\n## Example app\nExample 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.\nTo send Push notifications, you can use the online tool [PushWatch](https://www.pushwatch.com/gcm/).\n\nPlease test your PRs with this example app before submitting them. It'll help maintaining this repo.\n\n## Handling Notifications\nWhen any notification is opened or received the callback `onNotification` is called passing an object with the notification data.\n\nNotification object example:\n```javascript\n{\n    foreground: false, // BOOLEAN: If the notification was received in foreground or not\n    userInteraction: false, // BOOLEAN: If the notification was opened by the user from the notification area or not\n    message: 'My Notification Message', // STRING: The notification message\n    data: {}, // OBJECT: The push data\n}\n```\n\n## Local Notifications\n`PushNotification.localNotification(details: Object)`\n\nEXAMPLE:\n```javascript\nPushNotification.localNotification({\n    /* Android Only Properties */\n    id: '0', // (optional) Valid unique 32 bit integer specified as string. default: Autogenerated Unique ID\n    ticker: \"My Notification Ticker\", // (optional)\n    autoCancel: true, // (optional) default: true\n    largeIcon: \"ic_launcher\", // (optional) default: \"ic_launcher\"\n    smallIcon: \"ic_notification\", // (optional) default: \"ic_notification\" with fallback for \"ic_launcher\"\n    bigText: \"My big text that will be shown when notification is expanded\", // (optional) default: \"message\" prop\n    subText: \"This is a subText\", // (optional) default: none\n    color: \"red\", // (optional) default: system default\n    vibrate: true, // (optional) default: true\n    vibration: 300, // vibration length in milliseconds, ignored if vibrate=false, default: 1000\n    tag: 'some_tag', // (optional) add tag to message\n    group: \"group\", // (optional) add group to message\n    ongoing: false, // (optional) set whether this is an \"ongoing\" notification\n    priority: \"high\", // (optional) set notification priority, default: high\n    visibility: \"private\", // (optional) set notification visibility, default: private\n    importance: \"high\", // (optional) set notification importance, default: high\n\n    /* iOS only properties */\n    alertAction: // (optional) default: view\n    category: // (optional) default: null\n    userInfo: // (optional) default: null (object containing additional notification data)\n\n    /* iOS and Android properties */\n    title: \"My Notification Title\", // (optional)\n    message: \"My Notification Message\", // (required)\n    playSound: false, // (optional) default: true\n    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)\n    number: '10', // (optional) Valid 32 bit integer specified as string. default: none (Cannot be zero)\n    repeatType: 'day', // (optional) Repeating interval. Check 'Repeating Notifications' section for more info.\n    actions: '[\"Yes\", \"No\"]',  // (Android only) See the doc for notification actions to know more\n});\n```\n\n## Scheduled Notifications\n`PushNotification.localNotificationSchedule(details: Object)`\n\nEXAMPLE:\n```javascript\nPushNotification.localNotificationSchedule({\n  //... You can use all the options from localNotifications\n  message: \"My Notification Message\", // (required)\n  date: new Date(Date.now() + (60 * 1000)) // in 60 secs\n});\n```\n\n## Custom sounds\n\nIn android, add your custom sound file to `[project_root]/android/app/src/main/res/raw`\n\nIn iOS, add your custom sound file to the project `Resources` in xCode.\n\nIn the location notification json specify the full file name:\n\n    soundName: 'my_sound.mp3'\n\n## Cancelling notifications\n\n### 1) cancelLocalNotifications\n\n#### Android\nThe `id` parameter for `PushNotification.localNotification` is required for this operation. The id supplied will then be used for the cancel operation.\n\n```javascript\n// Android\nPushNotification.localNotification({\n    ...\n    id: '123'\n    ...\n});\nPushNotification.cancelLocalNotifications({id: '123'});\n```\n\n\n## Notification priority ##\n\n(optional) Specify `priority` to set priority of notification. Default value: \"high\"\n\nAvailable options:\n\n\"max\" = NotficationCompat.PRIORITY_MAX  \n\"high\" = NotficationCompat.PRIORITY_HIGH  \n\"low\" = NotficationCompat.PRIORITY_LOW  \n\"min\" = NotficationCompat.PRIORITY_MIN  \n\"default\" = NotficationCompat.PRIORITY_DEFAULT  \n\nMore information: https://developer.android.com/reference/android/app/Notification.html#PRIORITY_DEFAULT\n\n## Notification visibility ##\n\n(optional) Specify `visibility` to set visibility of notification. Default value: \"private\"\n\nAvailable options:\n\n\"private\" = NotficationCompat.VISIBILITY_PRIVATE  \n\"public\" = NotficationCompat.VISIBILITY_PUBLIC  \n\"secret\" = NotficationCompat.VISIBILITY_SECRET  \n\nMore information: https://developer.android.com/reference/android/app/Notification.html#VISIBILITY_PRIVATE\n\n## Notification importance ##\n\n(optional) Specify `importance` to set importance of notification. Default value: \"high\"\n\nAvailable options:\n\n\"default\" = NotificationManager.IMPORTANCE_DEFAULT  \n\"max\" = NotificationManager.IMPORTANCE_MAX  \n\"high\" = NotificationManager.IMPORTANCE_HIGH  \n\"low\" = NotificationManager.IMPORTANCE_LOW  \n\"min\" = NotificationManager.IMPORTANCE_MIN  \n\"none\" = NotificationManager.IMPORTANCE_NONE  \n\"unspecified\" = NotificationManager.IMPORTANCE_UNSPECIFIED  \n\nMore information: https://developer.android.com/reference/android/app/NotificationManager#IMPORTANCE_DEFAULT\n\n#### IOS\nThe `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.\n```javascript\n// IOS\nPushNotification.localNotification({\n    ...\n    userInfo: { id: '123' }\n    ...\n});\nPushNotification.cancelLocalNotifications({id: '123'});\n```\n\n\n### 2) cancelAllLocalNotifications\n\n`PushNotification.cancelAllLocalNotifications()`\n\nCancels all scheduled notifications AND clears the notifications alerts that are in the notification centre.\n\n*NOTE: there is currently no api for removing specific notification alerts from the notification centre.*\n\n## Repeating Notifications ##\n\n(optional) Specify `repeatType` and optionally `repeatTime` while scheduling the local notification. Check the local notification example above.\n\nProperty `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.\n\n## Notification Actions ##\n\n(Android only) [Refer](https://github.com/zo0r/react-native-push-notification/issues/151) to this issue to see an example of a notification action.\n\nTwo things are required to setup notification actions.\n\n### 1) Specify notification actions for a notification\nThis 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.\n\nFor e.g. `actions: '[\"Accept\", \"Reject\"]'  // Must be in string format`\n\nThe array itself is specified in string format to circumvent some problems because of the way JSON arrays are handled by react-native android bridge.\n\n### 2) Specify handlers for the notification actions\nFor each action specified in the `actions` field, we need to add a handler that is called when the user clicks on the action. This can be done in the `componentWillMount` of your main app file or in a separate file which is imported in your main app file. Notification actions handlers can be configured as below:\n\n```\nimport PushNotificationAndroid from 'react-native-push-notification'\n\n(function() {\n  // Register all the valid actions for notifications here and add the action handler for each action\n  PushNotificationAndroid.registerNotificationActions(['Accept','Reject','Yes','No']);\n  DeviceEventEmitter.addListener('notificationActionReceived', function(action){\n    console.log ('Notification action received: ' + action);\n    const info = JSON.parse(action.dataJSON);\n    if (info.action == 'Accept') {\n      // Do work pertaining to Accept action here\n    } else if (info.action == 'Reject') {\n      // Do work pertaining to Reject action here\n    }\n    // Add all the required actions handlers\n  });\n})();\n```\n\nFor iOS, you can use this [package](https://github.com/holmesal/react-native-ios-notification-actions) to add notification actions.\n\n## Set application badge icon\n\n`PushNotification.setApplicationIconBadgeNumber(number: number)`\n\nWorks natively in iOS.\n\nUses the [ShortcutBadger](https://github.com/leolin310148/ShortcutBadger) on Android, and as such will not work on all Android devices.\n\n## Sending Notification Data From Server\nSame parameters as `PushNotification.localNotification()`\n\n## Android Only Methods\n\n`PushNotification.subscribeToTopic(topic: string)` Subscribe to a topic (works only with Firebase)\n\n## Checking Notification Permissions\n`PushNotification.checkPermissions(callback: Function)` Check permissions\n\n`callback` will be invoked with a `permissions` object:\n- `alert`: boolean\n- `badge`: boolean\n- `sound`: boolean\n\n## iOS Only Methods\n\n`PushNotification.getApplicationIconBadgeNumber(callback: Function)` Get badge number\n\n`PushNotification.abandonPermissions()` Abandon permissions\n","readmeFilename":"README.md"}