{"id":21406389,"url":"https://github.com/chandler767/android-push-notifications","last_synced_at":"2025-07-14T00:32:29.984Z","repository":{"id":123047643,"uuid":"154730708","full_name":"chandler767/Android-Push-Notifications","owner":"chandler767","description":"Android push notification example using Firebase Cloud Messaging and PubNub","archived":false,"fork":false,"pushed_at":"2018-10-29T17:21:45.000Z","size":271,"stargazers_count":3,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T20:21:28.781Z","etag":null,"topics":["android","firebase","firebase-cloud-messaging","google","google-cloud-messaging","java","pubnub","pubsub","push-notifications"],"latest_commit_sha":null,"homepage":"https://www.pubnub.com/products/mobile-push-notifications/?devrel_gh=android-push-notifications","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chandler767.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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":"2018-10-25T20:06:10.000Z","updated_at":"2022-06-26T04:20:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"49147f80-46ce-4e80-91af-a46e72f5bd2e","html_url":"https://github.com/chandler767/Android-Push-Notifications","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chandler767/Android-Push-Notifications","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandler767%2FAndroid-Push-Notifications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandler767%2FAndroid-Push-Notifications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandler767%2FAndroid-Push-Notifications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandler767%2FAndroid-Push-Notifications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chandler767","download_url":"https://codeload.github.com/chandler767/Android-Push-Notifications/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chandler767%2FAndroid-Push-Notifications/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265227897,"owners_count":23731059,"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","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":["android","firebase","firebase-cloud-messaging","google","google-cloud-messaging","java","pubnub","pubsub","push-notifications"],"created_at":"2024-11-22T16:39:34.931Z","updated_at":"2025-07-14T00:32:29.976Z","avatar_url":"https://github.com/chandler767.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android Push Notification Example using Firebase Cloud Messaging and [PubNub](https://www.pubnub.com/blog/sending-android-mobile-push-notifications-firebase-cloud-messaging-pubnub/?devrel_gh=android-push-notifications).\n\nWhen building mobile applications in Android (and mobile applications in general), it is tough to think of a use case where you don’t need to communicate with mobile devices to sync data and notify users. For example, let’s consider the following scenario. You are developing a realtime sports application which feeds its users with critical news during a game. A key feature to the app would be to send reliable push notifications to the users as soon as their favorite team scores.\n\n\u003ca href=\"https://www.pubnub.com/blog/sending-android-mobile-push-notifications-firebase-cloud-messaging-pubnub/?devrel_gh=android-push-notifications\" target=\"_blank\" rel=\"noopener\"\u003e\u003cimg align=\"right\" src=\"/poweredbypubnub_325.gif\" alt=\"Push Notification Powered By PubNub\" width=\"325\" height=\"577\" /\u003e\u003c/a\u003e\n\n## How is PubNub Used With Push Notifications?\nIf you are using PubNub Data Streams, you are already communicating in realtime with all of your devices – but if you want to send push notifications for a native Android experience, FCM is a great ally.\n\nIf your application is destined for multiple platforms, the PubNub SDK makes your life easier by supporting Apple Push Notification Service (APNs) and FCM out of the box. Even if you don’t support multiple platforms yet, using the PubNub support for FCM will streamline your code by using a single set of libraries for PubNub Data Streams as well as FCM notifications.\n\nPubNub has an easy integration with FCM. A PubNub channel replaces the third party servers which send these notifications to Google’s FCM servers. You may have any registered endpoint send a push notification to your connected devices.\n\nThis allows the application to send push notifications to devices registered on specific channels in no time. It combines the native Android Notification API from Google with the realtime data stream network of PubNub. Your notifications will be natively understood by any Android device. If you already have FCM on your application and are considering using PubNub, you’ll hardly have to change anything about your app, most likely removing code!\n\nGoing back to the sports news app scenario, you can have your sports critic send the score in realtime from his phone and trigger a push notification to the rest of the audience’s devices. PubNub makes it simple – additional servers that you have to operate can be ruled out of the equation!\n\nThis project demonstrates how to setup FCM push notifications, enable PubNub push notifications, and configure the [PubNub Android SDK](https://www.pubnub.com/docs/android-java/pubnub-java-sdk?devrel_gh=android-push-notifications) to receive push notifications. Learn more from the tutorial [Sending Android Mobile Push Notifications with FCM and PubNub](https://www.pubnub.com/blog/sending-android-mobile-push-notifications-firebase-cloud-messaging-pubnub/?devrel_gh=android-push-notifications).\n\n\u003ca href=\"https://www.pubnub.com/blog/sending-android-mobile-push-notifications-firebase-cloud-messaging-pubnub/?devrel_gh=android-push-notifications\"\u003e\n    \u003cimg alt=\"PubNub Blog\" src=\"https://i.imgur.com/aJ927CO.png\" width=260 height=98/\u003e\n\u003c/a\u003e\n\n## Sending Push Notifications From PubNub\n\u003ca href=\"https://www.pubnub.com/products/mobile-push-notifications/?devrel_gh=android-push-notifications\" target=\"_blank\" rel=\"noopener\"\u003e\u003cimg align=\"right\" src=\"https://www.pubnub.com/blog/wp-content/uploads/2018/10/debugclient.png\" alt=\"PubNub Debug Client\" width=\"244\" height=\"350\" /\u003e\u003c/a\u003e\n\nIt’s important to note that the devices don’t need to subscribe to a channel to receive notifications for that channel. The devices only need to register to the channel for push notifications and then they will receive push notifications for any messages that have push notifications keys for that device type.\n\n* Associated FCM devices will receive only the data within the \u003ccode\u003epn_gcm\u003c/code\u003e key.\n* Native PubNub subscribers will receive the entire object literal, including the notification keys.\n\nIn this app the device is registered to the \"Notifications\" channel. Any messages sent to that channel with \u003ccode\u003epn_gcm\u003c/code\u003e keys will be sent as a push notification to registered devices.\n\nThe easiest way to test push notifications is to send them from the PubNub Debug Console from within the \u003ca href=\"https://admin.pubnub.com/?devrel_gh=android-push-notifications\" target=\"_blank\" rel=\"noopener\"\u003ePubNub Admin Dashboard\u003c/a\u003e.\n\nGo to your \u003ca href=\"https://admin.pubnub.com/?devrel_gh=android-push-notifications\" target=\"_blank\" rel=\"noopener\"\u003ePubNub Admin Dashboard\u003c/a\u003e, select your app, and then select your keyset.\n\nClick “Debug Console” and create a client with “Default Channel” set to \u003ccode\u003eNotifications\u003c/code\u003e.\n\nWith the client you just created you can send a notification to your device by sending a message containing the \u003ccode\u003epn_gcm\u003c/code\u003e keys.\n\nSend an Android push notification: \u003ccode\u003e{\"pn_gcm\":{\"notification\":{\"body\":\"Hello World.\"}}}\u003c/code\u003e\u003cspan class=\"aligncenter\"\u003e\n    \n\u003ca href=\"https://www.pubnub.com/blog/sending-android-mobile-push-notifications-firebase-cloud-messaging-pubnub/?devrel_gh=android-push-notifications\" target=\"_blank\" rel=\"noopener\"\u003e\u003cimg align=\"center\" src=\"https://www.pubnub.com/wp-content/uploads/2018/10/helloworld_short.gif\" alt=\"Hello World Android Push Notifications Powered By PubNub\" /\u003e\u003c/a\u003e\n\nRefer to the \u003ca href=\"https://support.pubnub.com/support/solutions/articles/14000043605-how-can-i-troubleshoot-my-push-notification-issues-?devrel_gh=android-push-notifications\" target=\"_blank\" rel=\"noopener\"\u003etroubleshooting guide\u003c/a\u003e if you have issues sending push notifications.\n\n\u003cstrong\u003eHave suggestions or questions about the content of this post? Reach out at \u003ca href=\"mailto:devrel@pubnub.com\" target=\"_blank\" rel=\"noopener\" data-rawhref=\"mailto:devrel@pubnub.com\"\u003edevrel@pubnub.com\u003c/a\u003e.\u003c/strong\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchandler767%2Fandroid-push-notifications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchandler767%2Fandroid-push-notifications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchandler767%2Fandroid-push-notifications/lists"}