Push Notifications on Unity Android?

Hey all,

I’ve been doing research for several days now, and I can’t seem to find anyone explaining how to do Push Notifications on Android either by plugin, or linking the Library or whatever.

Has anyone done Push on Android?

Thanks,
Nathan

Androids push works a bit very different compared to the iOS one

what do you want in detail? I assume remote push notifcations right as local push isn’t really needed on android, it has no ‘1 app only running’ dogma (or more precisely: thats what services are for on android)

typically you send push notifications from within Java code. Just make a method which takes 2 string parameters (or 3 if you want icon), us that to send the notification. Then just use JNI from within Unity to call that method.

Same goes for Intents etc. It’s to much of a pain in the ass, to make every thing via JNI calls from Unity3d

Hey guys,

Thanks for the info. Basically what I want to do in short detail is:

  1. I send a message through my app up to the server.
  2. The server (Urban Airship) will push the notification to the Android phone.
  3. User gets a notification that they got a message regardless of if app has been opened

Thanks a ton again,
Nathan

Hi All,
can you help me a bit more to send notification to user.
I want to send notification to user from my app using unity(android) on an event.

Edit: I need to use a Push service, and I thought about using PushWoosh. They provide plugins here: http://www.pushwoosh.com/programming-push-notification/unity-push-notification-sdk-integration/
So the question is resolved for me now, though it would be fine to have a not-so-specific solution…
Hi there,
I am very interested in this topic too. Has anybody got an answer about how to get remote notifications on Android Unity apps?
Thanks in advance!

Have you tried PushWoosh? I wonder if they support actual push notifications rather than local notifications only. They don’t say anything about setting up a php/mysql server in their short documentation, for instance…

Hey Nathan, I’m looking for Android push as well, did you find a solution?

Seems like the thing to do is go through GCM (Google Cloud Messaging) and even with that, I think your app needs to be open in order for a message to be received.

Just in case anyone is still looking for information on how to set up Remote Notifications in Android, I have an asset in the Asset Store that deals with this -and with iOS Push Notifications:

u3d.as/content/carlos-fernandez-musoles/easy-cross-platform-notifications

http://forum.unity3d.com/threads/185452-Easy-Cross-Platform-Notifications-available-now!

It contains everything you may need to set up your own Notification System, and it works cross-platform (from Android to iOS and vice versa).

Hope it helps!

Cheers,
Carlos.

Hi, I want to do the following on my Android game (and eventually on iOS too). Notify the player of my game that his “energy” has refilled so he can play again with a push notification. This “shouldn’t” require PHP or a database at all, just some timer code in the game with a non-dynamic message. Do I have to use Urban Airship or one of those services? If so, does this cost money on a recurring basis? If the answer is different for iOS, same question there.

Please check my answer to your query on the original post:

http://forum.unity3d.com/threads/185452-Easy-Cross-Platform-Notifications-available-now!

The answer basically depends on how your game knows a certain player has refilled energy. If it is remotely -i.e. in a server you own- then you could use remote notifications and my package ECPN is designed to help you set this up. If this is a timer -as I think is what you are using- then you should use local notifications, which certainly are in no need of using any servers -and I am afraid services like Urban Airship will be on the remote notification approach.

Check this one out
http://digitalcrackapp.com/images/androidpluginsunity/androidpluginsdemo.zip

Hey , You can easily integrate Push Notification on Android device using App42 API.

  1. App42 API support to Push Notification on cross platform.
    2 . You can refer this blog
    to integrate Push Notification in Unity using Android.
1 Like

We recently released a service & plugin for Unity3D push notifications. It’s designed especially for game developers and it’s well documented, so should meet your needs nicely. We have a bunch of Unity3D devs using it, & we use it for our own games.

Website: https://gamethrive.com
Documentation: http://docs.gamethrive.com/article/26-overview-using-gamethrive-in-your-unity3d-sdk-game

Hey,
Now there is a new asset available in the Asset Store - UTNotifications. It works seamlessly with both the scheduled and push notifications for Android (Google Play based & Amazon devices) and iOS. It’s an asset and not a service like GameThrive so it’s very customisable - the complete source code is provided for both the client & server sides (the server side is needed for push notifications only). As one of its developers I would be glad to assist you with its integration. Here is an API Reference: UTNotifications: Class List (the asset also includes the detailed step-by-step manual).
There is more here: [RELEASED] UTNotifications - Professional Cross Platform Push Notifications and More - Community Showcases - Unity Discussions

Hey zuja,
Easy Use and Simple Local/Server - Notification
Providing Android JAR Source Code.
Suitable for beginners Developers.

Does anybody have any info on how to retrieve the registration ID through native code via unity ? We don’t want to use a third party and wish to retrieve this ID to send to an existing third party server to handle the push notification. Thanks if anyone can advise!

The google play service API for //unity is limited and doesn’t allow API calls as such that are required to obtain this.

Hi marsoups,
Unity doesn’t support GCM directly indeed so if you want to avoid usage of any 3rd party code, you’ll have to add this support yourself using Native Plugins.
But you can also use client-side 3rd party solution, such as our UTNotifications. It assumes that you use your own server to send push notifications (but goes with a DemoServer written in Java that you can use as a reference and to check that a configuration is correct). It provides a convenient cross-platform client API for APNS (Apple Push Notification Service), GCM (Google Cloud Messaging) & ADM (Amazon Device Messaging). It is completely open source (including the native plugins) so you can change all you wish as you like. We are always glad to assist you: universal.tools.contact@gmail.com.

Hi Yuriy, I’m kinda interested in UTNotifications but I find it kinda pricey. Do you know if it has firebase integration? I need a way to reliably send local notifications (though push could work, as well) in both Android & iOS. Does UTNotification does it? Otherwise, what is the best way to do this in 2019? thanks!..

Just in case anyone else needs this in 2021, I have responded here: https://answers.unity.com/questions/197104/send-push-notifications-to-android-device.html?childToView=1850905#answer-1850905