{"id":14989438,"url":"https://github.com/alex-friedl/crossplatform-push-notifications-example","last_synced_at":"2025-10-12T22:29:04.957Z","repository":{"id":193958831,"uuid":"101433024","full_name":"alex-friedl/crossplatform-push-notifications-example","owner":"alex-friedl","description":"Example for crossplatform push notifications with node.js and React Native","archived":false,"fork":false,"pushed_at":"2018-05-14T20:38:30.000Z","size":39161,"stargazers_count":16,"open_issues_count":0,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T07:14:51.720Z","etag":null,"topics":["apn","docker","docker-compose","fcm","fcm-notifications","gcm","koa2","koajs","node-apn","node-gcm","node-js","node-pushnotifications","node-pushserver","nodejs","push-notifications","pushnotifications","react-native","reactnative","reactnativedemo"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/alex-friedl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-08-25T18:48:46.000Z","updated_at":"2024-01-05T18:06:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"888f1139-64fd-4738-8fae-96439eccd16a","html_url":"https://github.com/alex-friedl/crossplatform-push-notifications-example","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":0.2727272727272727,"last_synced_commit":"59536b82b86402fdea90f7f2f67a2958ae118612"},"previous_names":["alex-friedl/crossplatform-push-notifications-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alex-friedl/crossplatform-push-notifications-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-friedl%2Fcrossplatform-push-notifications-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-friedl%2Fcrossplatform-push-notifications-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-friedl%2Fcrossplatform-push-notifications-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-friedl%2Fcrossplatform-push-notifications-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alex-friedl","download_url":"https://codeload.github.com/alex-friedl/crossplatform-push-notifications-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-friedl%2Fcrossplatform-push-notifications-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013265,"owners_count":26085250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["apn","docker","docker-compose","fcm","fcm-notifications","gcm","koa2","koajs","node-apn","node-gcm","node-js","node-pushnotifications","node-pushserver","nodejs","push-notifications","pushnotifications","react-native","reactnative","reactnativedemo"],"created_at":"2024-09-24T14:18:22.445Z","updated_at":"2025-10-12T22:29:04.927Z","avatar_url":"https://github.com/alex-friedl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crossplatform Push-Notifications Demo\n\nThis is an example for a Crossplatform Push-Notification setup that works for both Android and iOS.\n\nThe example comprises of a server application written in [node.js](https://nodejs.org) that uses the [node-pushnotifications](https://github.com/appfeel/node-pushnotifications) library and a [React Native](https://facebook.github.io/react-native/) app that demonstrates the usage of the [react-native-push-notification](https://github.com/zo0r/react-native-push-notification) library and the [react-native-fcm](https://github.com/evollu/react-native-fcm) library.\n\nIt includes an example [Firebase](https://firebase.google.com/) application setup that works out of the box. \nIn order to use your own Firebase application, replace the `google-services.json` in the `app/android` directory, respectively the `GoogleService-Info.plist`in the `app/ios`directory with your own (downloadable in the [Firebase Console](https://console.firebase.google.com/)).\n\n## Requirements\n\n- Recommended: [Docker](https://www.docker.com/)\n- Optional (if you don't want to use Docker): \n  - [node.js 8.x.x](https://nodejs.org/en/download/current/)\n  - [MongoDB](https://docs.mongodb.com/getting-started/shell/installation/)\n- Android or iOS development setup (e.g. [Android Studio](https://developer.android.com/studio/index.html))\n\n## Setup\n\n- Optional: Install yarn (`npm install yarn -g`)\n- Run `npm install` or `yarn`\n\n## Run demo application\n\n### Start server\n\n- Run `docker-compose up`\n- Alternatively:\n  - Start MongoDB `mongod --dbpath=\u003cyourDbPath\u003e`\n  - Start server `npm run server`\n\n### Run app  \n\n- Start React Native app packager `npm run app-pkg`\n- Connect a device or start a simulator\n- Run Android app `npm run android`\n- Run iOS app `npm run ios`\n\n## What's happening?\n\nAfter application startup you should see a screen which displays your device token and the information that no notification has been received yet.\n\nThe device token should have been sent to the node.js server and stored in the MongoDB.\n\nIn order to send a sample push notification to all known device tokens execute `curl http://localhost:3000/push` or open [http://localhost:3000/push](http://localhost:3000/push) in your local browser.\n\nThe application should now display _Last notification title: Crossplatform push is working_.\n\n## Configuration options\n\n### Server\n\nIf you choose to run the backend locally without Docker, you can configure two parameters via environment variables:\n\n- _DB\\_HOST_: MongoDB host string\n- _SERVER\\_PORT_: HTTP port of the server application\n\n### App\n\nThe app uses the [react-native-config](https://github.com/luggit/react-native-config) library to configure its environment.\n\nYou can edit the *app/.env* file in order to configure the following:\n\n- _PUSH\\_LIB_: Determines which library will be used. Possible values:\n  - *fcm*: Use [react-native-fcm](https://github.com/evollu/react-native-fcm)\n  - *rn-push* (actually anything else as well): Use [react-native-push-notification](https://github.com/zo0r/react-native-push-notification)\n- SERVER_URL: Base URL of the server application\n\n## Known issues\n\n- Usage of `react-native-push-notification` for iOS currently not functional. Help appreciated.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex-friedl%2Fcrossplatform-push-notifications-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falex-friedl%2Fcrossplatform-push-notifications-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex-friedl%2Fcrossplatform-push-notifications-example/lists"}