{"id":18207558,"url":"https://github.com/magicbell/react-native-push-info","last_synced_at":"2026-02-13T07:02:21.186Z","repository":{"id":259324554,"uuid":"874731407","full_name":"magicbell/react-native-push-info","owner":"magicbell","description":"Essential information for interacting with push notification APIs like APNs and FCM.","archived":false,"fork":false,"pushed_at":"2024-12-18T13:53:29.000Z","size":2914,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-22T19:52:45.217Z","etag":null,"topics":["apns","fcm","push-notifications","react-native"],"latest_commit_sha":null,"homepage":"http://www.magicbell.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magicbell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-18T11:09:00.000Z","updated_at":"2025-06-06T14:47:27.000Z","dependencies_parsed_at":"2025-04-10T08:59:40.706Z","dependency_job_id":"8b8962d8-1843-488c-a3f9-d794160f07a7","html_url":"https://github.com/magicbell/react-native-push-info","commit_stats":null,"previous_names":["magicbell/react-native-push-info"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/magicbell/react-native-push-info","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicbell%2Freact-native-push-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicbell%2Freact-native-push-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicbell%2Freact-native-push-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicbell%2Freact-native-push-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magicbell","download_url":"https://codeload.github.com/magicbell/react-native-push-info/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicbell%2Freact-native-push-info/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29398155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apns","fcm","push-notifications","react-native"],"created_at":"2024-11-03T13:03:27.131Z","updated_at":"2026-02-13T07:02:21.153Z","avatar_url":"https://github.com/magicbell.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-push-info\n\n✨ Essential information for interacting with push notification APIs like APNs and FCM.\n\nThis library is useful when you cannot (or do not want to) hardcode the constants needed to send requests to Apple's APNs and Google's FCM servers. These include:\n\n- The applications bundle ID (iOS) or application ID (Android)\n- (iOS only) The developer Team ID under which the app was codesigned\n- (iOS only) The app's APNs environment to receive push notifications in\n\nLook at a common [usage scenario](#usage-scenario) to see if you could benefit from using `react-native-push-info`.\n\n## TOC\n\n\u003c!-- TOC --\u003e\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API](#api)\n  - [iOS](#ios)\n  - [Android](#android)\n- [Usage scenario](#usage-scenario)\n- [Contributing](#contributing)\n- [License](#license)\n\n\u003c!-- /TOC --\u003e\n\n## Installation\n\nUsing npm:\n\n```sh\nnpm install react-native-push-info\n```\nor using yarn:\n\n```sh\nyarn add react-native-push-info\n```\n\n## Usage\n\n```js\nimport { Platform } from 'react-native'\nimport { getAndroidApplicationId, getIOSAPNSEnvironment, getIOSBundleId, getIOSTeamId } from 'react-native-push-info'\n\nconst payload = Platform.select({\n  ios: {\n    bundleId: getIOSBundleId(),\n    teamId: getIOSTeamId() ?? 'SOME_DEFAULT',\n    apnsEnvironment: getIOSAPNSEnvironment() ?? 'development'\n },\n  android: {\n    applicationId: getAndroidApplicationId()\n }\n})\n```\n\n## API\n\nThe API is very platform-specific and offers two sets of functions for iOS and Android.\nEach method returns synchronously and will throw an `Error` when invoked on the wrong platform.\n\n**Attention**: Some of the methods on iOS might return `undefined` if the application is running in an unsigned environment. Please refer to the docs and types for more information.\n\n### iOS\n\n| Method                  | Description                                          | Expect `undefined`?                                                    |\n| ----------------------- | ---------------------------------------------------- | ---------------------------------------------------------------------- |\n| `getIOSBundleId`        | Returns the applications bundle ID.                  | No. This method always returns a valid value.                          |\n| `getIOSTeamId`          | Returns the team ID used to sign the application.    | Yes. It might return `undefined` when running in an unsigned environment. |\n| `getIOSAPNSEnvironment` | Returns the APNs environment the app was signed for. | Yes. It might return `undefined` when running in an unsigned environment. |\n\n### Android\n\n| Method                    | Description                  | Expect `undefined`?                           |\n| ------------------------- | ---------------------------- | --------------------------------------------- |\n| `getAndroidApplicationId` | Returns the application ID. | No. This method always returns a valid value. |\n\n\n## Usage scenario\n\n**Internally vs. externally distributed iOS builds**\n\nThis library is most helpful if you maintain different builds of your app, distributed publicly on the AppStore and internally. In a typical setup, internal builds are signed with an [enterprise account](https://developer.apple.com/programs/enterprise/) and, therefore, use a different team ID and APNs key than the AppStore build. In this scenario, it is good practice to send the applications device token, together with the corresponding team ID, to your backend so it has all the information needed to send requests to the APNs server.\n\nPeople often are unsure which [APNs environment](https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment) to use when sending pushes. Using this library you know exactly which environment your app was in when it requested its device token, and can pass that info to your servers as well.\n\nFinally, you might find yourself with different internal builds of your app, using different bundle identifiers (e.g. for a nightly build, for a release candidate, or PR builds). The library has got you covered here as well, as it supports getting this value at runtime, too.\n\n\n## Contributing\n\nContributions of any kind are welcome.\n\nSee the [contributing guide](./CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\n`react-native-push-info` is build by [MagicBell, Inc.](https://www.magicbell.com) and it's [contributors](./graphs/contributors).\n\nIt is released under the [MIT license](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicbell%2Freact-native-push-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagicbell%2Freact-native-push-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicbell%2Freact-native-push-info/lists"}