{"_id":"@bondulich/react-native-notification-badge","_rev":"2-c21943c32bb4a17ffb3f896f875c1ad8","name":"@bondulich/react-native-notification-badge","dist-tags":{"latest":"1.0.7"},"versions":{"1.0.5":{"name":"@bondulich/react-native-notification-badge","version":"1.0.5","keywords":["react-native","notification","badge","count","native-module"],"author":{"name":"Marc Rousavy","email":"marcrousavy@hotmail.com"},"license":"MIT","_id":"@bondulich/react-native-notification-badge@1.0.5","maintainers":[{"name":"bondulich","email":"bondulich12@gmail.com"}],"homepage":"https://github.com/bondulich/react-native-notification-badge#readme","bugs":{"url":"https://github.com/bondulich/react-native-notification-badge/issues"},"dist":{"shasum":"65f149b511750c1aa960fd69c44f22c3112425ce","tarball":"https://registry.npmjs.org/@bondulich/react-native-notification-badge/-/react-native-notification-badge-1.0.5.tgz","fileCount":9,"integrity":"sha512-B3T6Ew1l4/AL5P1jymprOYMWzOabWmmPQ8uwN54k/kJMyLbvA3VUfudSjzOIibDttl/yJi/UWFQklzeOg415nw==","signatures":[{"sig":"MEYCIQC7Ge5lmtlOgRlwjRA2uWu6DkNEYVneUmHJwOmqLNSEcQIhALE49Uls+7Okrl7bSmo/W5vpgzMje4i/NP4BM6eTSKHV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26100},"main":"dist/index.js","title":"React Native Notification Badge","types":"dist/index.d.ts","gitHead":"f2807f9a32e8474d0cfb25eb883ef8c610661965","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"bondulich","email":"bondulich12@gmail.com"},"repository":{"url":"git+https://github.com/bondulich/react-native-notification-badge.git","type":"git","baseUrl":"https://github.com/bondulich/react-native-notification-badge"},"_npmVersion":"10.7.0","description":"A notification badge count manager for React Native","directories":{},"_nodeVersion":"20.15.0","_hasShrinkwrap":false,"devDependencies":{"react":"^16.9.0","eslint":"^7.1.0","typescript":"^3.9.3","react-native":"^0.61.5","@types/react-native":"^0.62.12"},"licenseFilename":"LICENSE","peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-native-notification-badge_1.0.5_1726069634741_0.2776798226298425","host":"s3://npm-registry-packages"}},"1.0.6":{"name":"@bondulich/react-native-notification-badge","version":"1.0.6","keywords":["react-native","notification","badge","count","native-module"],"author":{"name":"Marc Rousavy","email":"marcrousavy@hotmail.com"},"license":"MIT","_id":"@bondulich/react-native-notification-badge@1.0.6","maintainers":[{"name":"bondulich","email":"bondulich12@gmail.com"}],"homepage":"https://github.com/bondulich/react-native-notification-badge#readme","bugs":{"url":"https://github.com/bondulich/react-native-notification-badge/issues"},"dist":{"shasum":"98e12cd2cbb3f529b670373f60cdd8cd5c06b246","tarball":"https://registry.npmjs.org/@bondulich/react-native-notification-badge/-/react-native-notification-badge-1.0.6.tgz","fileCount":9,"integrity":"sha512-7DqGup0pzX7qj4S1CHtoZUfJlN3A8lPAmd8ncxP0SAepmHD+TVZ8ULs1MW+RTSBRyxeVfJK3Dc/tOF529+e3/Q==","signatures":[{"sig":"MEUCIQCcgBgDRDdFnxOiDMmUs4n9RcHi8xXi2mSXWDriUBRiJwIgLoBKkliKHGRooHTdnOWCaB9ZQxikJV1zylvYL4Vd5vw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26144},"main":"dist/index.js","title":"React Native Notification Badge","types":"dist/index.d.ts","gitHead":"2cf75f8e29a5079fec80c1a92eedbb0f82dccf06","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"bondulich","email":"bondulich12@gmail.com"},"repository":{"url":"git+https://github.com/bondulich/react-native-notification-badge.git","type":"git","baseUrl":"https://github.com/bondulich/react-native-notification-badge"},"_npmVersion":"10.7.0","description":"A notification badge count manager for React Native","directories":{},"_nodeVersion":"20.15.0","_hasShrinkwrap":false,"devDependencies":{"react":"^16.9.0","eslint":"^7.1.0","typescript":"^3.9.3","react-native":"^0.61.5","@types/react-native":"^0.62.12"},"licenseFilename":"LICENSE","peerDependencies":{"react":"*","react-native":"*"},"_npmOperationalInternal":{"tmp":"tmp/react-native-notification-badge_1.0.6_1726070513102_0.25106972403865613","host":"s3://npm-registry-packages"}},"1.0.7":{"name":"@bondulich/react-native-notification-badge","title":"React Native Notification Badge","version":"1.0.7","description":"A notification badge count manager for React Native","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/bondulich/react-native-notification-badge.git","baseUrl":"https://github.com/bondulich/react-native-notification-badge"},"keywords":["react-native","notification","badge","count","native-module"],"author":{"name":"Marc Rousavy","email":"marcrousavy@hotmail.com"},"license":"MIT","licenseFilename":"LICENSE","peerDependencies":{"react":"*","react-native":"*"},"devDependencies":{"@types/react-native":"^0.62.12","react":"^16.9.0","react-native":"^0.61.5","eslint":"^7.1.0","typescript":"^3.9.3"},"gitHead":"9c147474b9e23ed3186d0937e68770303bb7e5bc","bugs":{"url":"https://github.com/bondulich/react-native-notification-badge/issues"},"homepage":"https://github.com/bondulich/react-native-notification-badge#readme","_id":"@bondulich/react-native-notification-badge@1.0.7","_nodeVersion":"14.15.0","_npmVersion":"7.6.3","dist":{"integrity":"sha512-HXBazNWgtmilwKy1WwibJDmcLXfLE4/m1jVtIofBI96TkgGl4b+vUs06FIcPItzuMrOv+1vR8KQ/VQZsDewrfw==","shasum":"daa29d8a35b58d47faa7b5a43db4d1d7541f4f33","tarball":"https://registry.npmjs.org/@bondulich/react-native-notification-badge/-/react-native-notification-badge-1.0.7.tgz","fileCount":11,"unpackedSize":33006,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtBq7NNxAUAzk/914h6m4S/luU3uH3pHEzocUOR1SDXgIgdHs8fo1xs8GsnyqpWgw7qyk8uCy9BTThiIzQduz+zvA="}]},"_npmUser":{"name":"bondulich","email":"bondulich12@gmail.com"},"directories":{},"maintainers":[{"name":"bondulich","email":"bondulich12@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-notification-badge_1.0.7_1726072332645_0.030728989676179763"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-11T15:47:14.610Z","modified":"2024-09-11T16:32:12.973Z","1.0.5":"2024-09-11T15:47:14.897Z","1.0.6":"2024-09-11T16:01:53.226Z","1.0.7":"2024-09-11T16:32:12.793Z"},"bugs":{"url":"https://github.com/bondulich/react-native-notification-badge/issues"},"author":{"name":"Marc Rousavy","email":"marcrousavy@hotmail.com"},"license":"MIT","homepage":"https://github.com/bondulich/react-native-notification-badge#readme","keywords":["react-native","notification","badge","count","native-module"],"repository":{"type":"git","url":"git+https://github.com/bondulich/react-native-notification-badge.git","baseUrl":"https://github.com/bondulich/react-native-notification-badge"},"description":"A notification badge count manager for React Native","maintainers":[{"name":"bondulich","email":"bondulich12@gmail.com"}],"readme":"# react-native-notification-badge\n\n> For when you don't want to use a fully featured notification manager\n\nA very simple notification badge count manager for React Native that just works.\n\n[![react-native-notification-badge](https://badge.fury.io/js/react-native-notification-badge.svg)](https://badge.fury.io/js/react-native-notification-badge)\n[![GitHub stars](https://img.shields.io/github/stars/mrousavy/react-native-notification-badge.svg?style=social&label=Star&maxAge=259000)](https://github.com/mrousavy/react-native-notification-badge/stargazers/)\n[![GitHub followers](https://img.shields.io/github/followers/mrousavy.svg?style=social&label=Follow&maxAge=259000)](https://github.com/mrousavy?tab=followers)\n\n<a href='https://ko-fi.com/F1F8CLXG' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi2.png?v=0' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>\n\n## Installation\n\n1. `npm install @bondulich/react-native-notification-badge` or `yarn add @bondulich/react-native-notification-badge`\n2. `cd ios && pod install`\n\n## API\n\n**Note: All APIs throw if `Platform.OS !== 'ios'`!**. So wrap your calls with a `Platform.OS` check first.\n\n```ts\nimport {setBadgeCount} from '@bondulich/react-native-notification-badge';\nimport {Platform} from 'react-native';\n\nif (Platform.OS === 'ios') {\n  await setBadgeCount(0);\n}\n```\n\n### `getBadgeCount`\n\n**Asynchronously returns the current Badge count.**\n\nNote: If no notification permissions have been granted yet, this will also ask the user for notification permissions (only `[.badge]`), so request permissions before calling this using a library like [react-native-permissions](https://github.com/react-native-community/react-native-permissions)\n\n```ts\nconst badgeCount = await getBadgeCount()\n```\n\n### `getBadgeCountSync`\n\nSame as [`getBadgeCount`](#getbadgecount), but synchronously.\n\n```ts\nconst badgeCount = getBadgeCountSync()\n```\n\n### `setBadgeCount`\n\n**Asynchronously sets the Badge count.**\n\nNote: If no notification permissions have been granted yet, this will also ask the user for notification permissions (only `[.badge]`), so request permissions before calling this using a library like [react-native-permissions](https://github.com/react-native-community/react-native-permissions)\n\n```ts\nawait setBadgeCount(2)\n```\n\n### `getNotificationBadgeSetting`\n\n**Asynchronously gets the current state of the \"Notification Badge\" permission setting.**\n\nPossible values are: `'enabled' | 'disabled' | 'notSupported' | 'unknown'`\n\n```ts\nconst permission = await getNotificationBadgeSetting()\nif (permission === 'enabled') {\n  await setBadgeCount(5)\n} else {\n  console.log(\"Badge permission has not yet been granted. I'll ask the user later\")\n}\n```\n\n### `requestNotificationPermissions`\n\n**Asynchronously request the user to grant the specified permissions.**\n\nPossible parameter values are: `['badge' | 'alert' | 'sound' | 'carPlay' | 'criticalAlert' | 'providesAppNotificationSettings' | 'provisional' | 'announcement']`\n\n```ts\nconst granted = await requestNotificationPermissions(['badge', 'alert', 'sound'])\n```\n\n### `removeNotificationsWithThreadId`\n\n**Remove all notification with the given Thread ID from the User's Notification Center.**\n\n> The Thread ID is a property in the APNS payload which can be used to group notifications in **iOS 10.0** or higher.\n\nReturns the count of notifications that were removed.\n\n```ts\nconst removed = await removeNotificationsWithThreadId('group-chat-2')\n```\n\n\n## Other\n\nCheck out my other react-native libraries:\n\n* [react-native-blurhash](https://github.com/mrousavy/react-native-blurhash): 🖼️ Give your users the loading experience they want.\n* [react-native-google-nearby-messages](https://github.com/mrousavy/react-native-google-nearby-messages): 📲 Communicate with nearby devices using Bluetooth, BLE, WiFi and near-ultrasonic audio. Broadcast and receive small payloads (like strings) using the easy-to-use React Native API!\n* [react-native-sectioned-slider](https://github.com/mrousavy/react-native-sectioned-slider): An iOS 11 Control Center inspired Slider for React Native\n","readmeFilename":"README.md"}