- Home /
Send Push Notifications to Android Device
How would you go about sending push notifications to an Android Device? Is it possible?
Thanks
Answer by CarlosFM · Jun 21, 2013 at 03:21 PM
I realise this is an old post and that you may not be interested in the answer anymore. But just for reference, here is my answer:
Yes, it is possible to send remote notifications to android devices. Depending on what you mean this is straightforward or slightly more complex: -If you mean sending a notification from you (a website, server...) to an android device, or if you want to send notifications in between users, this can be achieved using the Google Cloud Messaging service. -If you meant sending an actual push notification from an iOS device to an android device, this is slightly more complicated, as it involves coordinating both android and iOS devices via a server, and making use of GCM and possibly Apple Push Notification Services (if you want android to iOS messaging).
In any case, I've developed an asset that allows you to do both! So you can bring remote notifications to your unity projects (no matter if they are iOS or Android, it's fully cross-platform!)
Here is a link to the Asset Store: EASY Cross-platform Notifications
It comes with a full step-by-step guide to help you set the system up.
Answer by Yuriy-Ivanov · Jun 14, 2015 at 02:01 PM
Hey, Please note, that Google Cloud Messaging is not universal solution for the push notifications in Android. Amazon devices (entire Amazon Kindle series) doesn't support it. But there is now a new asset available in the Asset Store - UTNotifications. It works seamlessly with both the local and push notifications for Android (Google Play based & Amazon devices) and iOS. It's very customisable - the complete source code is provided for both the client & server sides. As one of its developers I would be glad to assist you with its integration. Here is an API Reference: http://universal-tools.github.io/UTNotifications/html/annotated.html (the asset also includes the detailed step-by-step manual). There is more here: http://forum.unity3d.com/threads/re...-platform-push-notifications-and-more.333045/
Answer by dhruvc · Sep 11, 2013 at 04:26 PM
Shephertz backend APIs for push can be integrated with Unity on Android. While sending a push is a straight forward REST request, receiving is a bit tricky. I recommend you going through this blog post - it contains all the integration steps. http://blogs.shephertz.com/2013/07/09/steps-to-integrate-push-notification-with-unity-sample-on-android/
Answer by Voxel-Busters · Aug 11, 2015 at 11:02 AM
Google Cloud Messaging is used for setting up notifications on Android. You need to write a plugin by calling the required methods.
Steps involved are
Once you get senderId from google play dev console, register to GCM with senderId
On Registration, you will get a device token/Registration Id and this will be used to send notifications to device.
Send this id to your server and request GCM to deliver a payload with required registration Ids
Add a wakeful service and receive the notification payload on your device
Parse the payload and fire notification with NotificationCompat
To make the process simpler, We developed a **Cross Platform Native Plugins** which supports Local & Remote Notifications along with many other useful features (IAP, Webview, Sharing...). You can try out lite version incase if you want to test the plugin.
Its a Unified API and same code works on both iOS and Android(Play Store) platforms.
Unfortunately, as I already mentioned above, Google Cloud $$anonymous$$essaging is supported by not all Android devices. If you want to support as much Android devices as possible, take a look at UTNotifications ins$$anonymous$$d.
@Voxel Busters I downloaded the package but not able to get remote notification. Although when application is open I receive the message but not when application is in background.
Answer by Aligdev · Jul 25, 2021 at 11:17 AM
Now, years later, Google Cloud Messaging id deprecated and is replaced by Firebase Cloud Messaging. It supports both iOS and Android (I personally prefer Apple Push Notification service for iOS). Here is the documentation:
https://firebase.google.com/docs/cloud-messaging/
and docs for Unity integration:
https://firebase.google.com/docs/cloud-messaging/unity/client
Your answer
Follow this Question
Related Questions
Android pin push notifications 1 Answer
Finding out if a user entered the game from notification (iOS/Android) 2 Answers
Hangs on "Pushing new content to device" when using "Build and Run" with android 1 Answer
Android notification issue 0 Answers
Opening android notification setting menu from my app? 0 Answers