{"id":4626,"url":"https://github.com/lilach/react-native-push-with-gcm","last_synced_at":"2026-01-14T13:06:46.102Z","repository":{"id":57339375,"uuid":"58057081","full_name":"lilach/react-native-push-with-gcm","owner":"lilach","description":"Register device for GCM push notifications services","archived":false,"fork":false,"pushed_at":"2016-09-29T09:46:24.000Z","size":25,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-01T02:48:12.937Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/lilach.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-04T14:08:31.000Z","updated_at":"2018-05-18T20:57:17.000Z","dependencies_parsed_at":"2022-09-16T07:50:40.741Z","dependency_job_id":null,"html_url":"https://github.com/lilach/react-native-push-with-gcm","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/lilach/react-native-push-with-gcm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilach%2Freact-native-push-with-gcm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilach%2Freact-native-push-with-gcm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilach%2Freact-native-push-with-gcm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilach%2Freact-native-push-with-gcm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lilach","download_url":"https://codeload.github.com/lilach/react-native-push-with-gcm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lilach%2Freact-native-push-with-gcm/sbom","scorecard":{"id":589785,"data":{"date":"2025-08-11","repo":{"name":"github.com/lilach/react-native-push-with-gcm","commit":"b55cc2063e4c29271c1230ece2d92a755e089ac1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/14 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 17 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T21:33:10.408Z","repository_id":57339375,"created_at":"2025-08-20T21:33:10.408Z","updated_at":"2025-08-20T21:33:10.408Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28420817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2024-01-05T20:17:18.328Z","updated_at":"2026-01-14T13:06:46.086Z","avatar_url":"https://github.com/lilach.png","language":"Objective-C","funding_links":[],"categories":["Components"],"sub_categories":["System"],"readme":"# react-native-push-with-gcm\n\n[![npm\nversion](https://badge.fury.io/js/react-native-push-with-gcm@2x.png)](http://badge.fury.io/js/react-native-push-with-gcm)\n\nRegister device for GCM push notifications services.\n\n## Installation\n\nMake sure that you are in your React Native project directory and run:\n\n```bash\nnpm install react-native-push-with-gcm --save\n```\n\n### Installing with rnpm\n\n```bash\nrnpm install react-native-push-with-gcm\n```\nwill install the npm package and link it to your project.\n\nIf you already installed the package using the previous command,\n```bash\nrnpm link react-native-push-with-gcm\n```\nwill magically link it\n\n### Installing manually\n\n#### iOS\n\nIn XCode, in the project navigator:\n- Right click Libraries\n- Add Files to [your project's name]\n- Go to node_modules/react-native-push-with-gcm\n- Add the Add the .xcodeproj file\n\nIn XCode, in the project navigator, select your project.\n\nAdd the libRCTPushWithGCM.a from the deviceinfo project to your project's\nBuild Phases ➜ Link Binary With Libraries\nClick .xcodeproj file you added before in the project navigator and go\nthe Build Settings tab. Make sure 'All' is toggled on (instead of\n'Basic').\nLook for Header Search Paths and add this as `non-recursive`:\n`$(SRCROOT)/../node_modules/react-native-push-with-gcm/ios/RCTPushWithGCM/RCTPushWithGCM`\n\n#### Android\n\n- Edit `build.gradle` to look like this:\n```java\napply plugin: 'com.android.application'\n\nandroid {\n  ...\n}\n\ndependencies {\n  ...\n+ compile project(':react-native-push-with-gcm')\n}\n```\n\n- In `settings.gradle`, insert the following code:\n```\ninclude ':react-native-push-with-gcm'\nproject(':react-native-push-with-gcm').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-push-with-gcm/android')\n```\n\n## Requirements\n\n- Google Cloud Messaging. You can find the instructions\n  [here](https://developers.google.com/cloud-messaging/ios/start).\n- react-native\n\n## Usage\n\n### Setup\n\n#### iOS\n\nFor iOS devices only, you'll need to configure and connect to GCM:\n\n```javascript\nvar PushWithGCM = require('react-native-push-with-gcm')\n\ncomponentDidMount() {\n  PushWithGCM.configure()\n}\n```\n\nOnce your app registers for push notifications, grab that token\n(PushNotificationsIOS will give this token as a string) and register\nthat token in GCM. You also need to supply a boolean value for your APNS\nserver sandbox option (hint: sandbox is used for development):\n\n```javascript\nPushWithGCM.registerToken(token, isSandbox)\n```\n\nTo unregister a user from GCM service:\n```javascript\nPushWithGCM.unregisterToken()\n```\n\u003e Note, you can only have one token or deleteToken call for a given\n\u003e authorizedEntity and scope at a point of time. Making another such\n\u003e call with the same authorizedEntity and scope before the last one\n\u003e finishes will result in an error with code OperationInProgress.\n\u003e\n\u003e (from the\n\u003e [docs](https://developers.google.com/instance-id/reference/ios/api/interface_g_g_l_instance_i_d.html#method-detail))\n\n#### Android\n\n- Get a `GCM_SENDER_ID` by registering your app in the following [link](https://developers.google.com/mobile/add).\n\n- Edit your MainActivity.java to look like this:\n```\npackage com.myapp;\n\n+ import com.oblador.keychain.KeychainPackage;\n....\n\npublic class MainActivity extends extends ReactActivity {\n\n  @Override\n  protected List\u003cReactPackage\u003e getPackages() {\n      return Arrays.\u003cReactPackage\u003easList(\n              new MainReactPackage(),\n+             new PushWithGCMPackage(\u003cGCM_SENDER_ID\u003e)\n      );\n  }\n  ...\n}\n```\n\n- Create a GCM listener service to handle received notifications:\n\n```\npackage com.myklarnamobile;\n\nimport com.google.android.gms.gcm.GcmListenerService;\n\npublic class PushWithGCMListenerService extends GcmListenerService {\n    @Override\n    public void OnMessage(String from, Bundle data) {\n    // Customized notification handling.\n    }\n}\n```\n\n\u003e For more information, read [overview of GCM message format] (https://developers.google.com/cloud-messaging/concept-options#notifications_and_data_messages) and [guide for implementing a GCM listener service](https://developers.google.com/cloud-messaging/downstream).\n\n- Edit your AndroidManifest.xml to look like this:\n\n```\n\u003cmanifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"\u003cYOUR_PACKAGE_NAME\u003e\"\u003e\n    ...\n+   \u003cpermission android:name=\"com.myklarnamobile.permission.C2D_MESSAGE\"\n+       android:protectionLevel=\"signature\" /\u003e\n+   \u003cuses-permission android:name=\"com.myklarnamobile.permission.C2D_MESSAGE\" /\u003e\n+   \u003cuses-permission android:name=\"android.permission.WAKE_LOCK\" /\u003e\n\n    \u003capplication\u003e\n      ...\n+     \u003creceiver\n+       android:name=\"com.google.android.gms.gcm.GcmReceiver\"\n+       android:exported=\"true\"\n+       android:permission=\"com.google.android.c2dm.permission.SEND\" \u003e\n+       \u003cintent-filter\u003e\n+         \u003caction android:name=\"com.google.android.c2dm.intent.RECEIVE\" /\u003e\n+         \u003caction android:name=\"com.google.android.c2dm.intent.REGISTRATION\" /\u003e\n+           \u003ccategory android:name=\"com.myklarnamobile\" /\u003e\n+       \u003c/intent-filter\u003e\n+     \u003c/receiver\u003e\n+     \u003cservice android:name=\"\u003cYOUR_PACKAGE_NAME\u003e.PushWithGCMListenerService\"\n+              android:exported=\"false\" \u003e\n+       \u003cintent-filter\u003e\n+         \u003caction android:name=\"com.google.android.c2dm.intent.RECEIVE\" /\u003e\n+       \u003c/intent-filter\u003e\n+     \u003c/service\u003e\n+     \u003cservice\n+         android:name=\"com.pushwithgcm.GCMInstanceIDListenerService\"\n+         android:exported=\"false\"\u003e\n+       \u003cintent-filter\u003e\n+         \u003caction android:name=\"com.google.android.gms.iid.InstanceID\" /\u003e\n+       \u003c/intent-filter\u003e\n+     \u003c/service\u003e\n    \u003c/application\u003e\n\u003c/manifest\u003e\n```\n\n### Subscription to topics\nIf there are topics you'd like this device to be registered to, you can\neasily do that too. after registration send an array of all the topics\nto register to:\n\n```javascript\nPushWithGCM.subscribeToTopics(['push', 'with', 'gcm'])\n```\nThese topics will be registered as `/topics/push`, `/topics/with` and\n`/topics/gcm`.\n\nWhen you're done with these topics, simply call\n```js\nPushWithGCM.unsubscribeFromTopics(['first-time-users'])\n```\n\n## Troubleshooting\n\nIf you installed GoogleCloudMessaging using cocoapods (which is the\nrecommended way, so awesome) and are having trouble with compiling the\napp, make sure these properties are set properly in your XCode project:\n\n- add `$(inherited)` to `Other Linker Flags` (or `OTHER_LDFLAGS`)\n- set `Enable Modules` to `YES`\n- set `iOS Deployment Target` to `7.1` at least\n- set `Enable Bitcode` to `NO`\n\n## Contributing\n\n1. Fork it (\n   https://github.com/lilach/react-native-push-with-gcm/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flilach%2Freact-native-push-with-gcm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flilach%2Freact-native-push-with-gcm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flilach%2Freact-native-push-with-gcm/lists"}