- Home /
Android & iOS Push Notifications
Hi. I am developing an application in Unity 3D 5 for Android and iOS. I need the users to be able to sign up for push (remote) notifications. I also need to send the push message from a PHP file. Let's say 3 out of 5 users have created a Search. It could be something like "Cars for sale". The PHP file will then determine whether or not to send a push message.
In short: I know how to do the PHP stuff, but what I need to know is how to do the following:
Register device token to my hosted MySQL. Add Searches (values) next to the device token in the MySQL table. Send push notifications (to both platforms) from a hosted PHP script.
I have tried the following:
PushWoosh (not able to individually send push) ECPN (outdated, no response from developer) App42 (not able to individually send push, or at least I could not figure out how) Parse (Builded app crashes on all devices)
Best regards, Andreas.
Answer by Voxel-Busters · Aug 11, 2015 at 11:42 AM
For using notifications,
GCM(Play Store targeted products) will be used on Android and APNS on iOS
Once you launch your app, you will register for respective service and get a token after registration
Once you get the token/RegistrationID , you will pass it to your server and here you need to save it to the players profile for easy access later.
For sending a notification to an user, Get the token/registrationID assigned to the player profile and send the request with the payload to GCM , and APNS on Android, iOS respectively.
Now GCM and APNS will contact the device and push the payload.
On receiving payload, on Android you need to do handle on your own to display it where as on iOS its automated.
Hope it gave a clear idea on how it works.
Adding to this, We developed Cross Platform Native Plugins to simplify the whole process of handling local and remote notifications on iOS and Android with a unified API interface for iOS and Android(play store) platforms. It has many other features along with notifications and comes with a unified API for both iOS and Android.
Answer by Yuriy-Ivanov · Jun 14, 2015 at 02:03 PM
Hey Andreas,
You can try this new asset: http://forum.unity3d.com/threads/released-utnotifications-professional-cross-platform-push-notifications-and-more.333045/ It can do all you need and works fine with Unity 5. Its demo server is written in Java, but as it uses just native push notifications API for each supported platform (iOS, Google Play based Android devices and Amazon Android devices) you can use a number of PHP examples or ready solutions. I'm one of the UTNotifications developers and will be happy to help you with it.
Best regards, Yuriy.
Answer by ajaybhojani · May 27, 2016 at 05:28 AM
Hi .. i have purhcased UTPush Notification.(https://www.assetstore.unity3d.com/en/#!/content/37767). And running in unity4.6.1f1 with c#. Want to integrate push notification for android and ios. I am following same step as per manual and read whole manual, but confused on server setup. "Demo server" is working in my local pc. Integrated for ios. when I am sending notification from ipad , it gives me output in demo server- Eclipse as "Notified client 1", and so On. Now I want to send notification to all ipad devices who has installed the app then how its possible ? Demo server is running on local machine. 1. So here question is how to setup these demo server file on my own server ? 2.Or if it is possible with any other third party server service , How it can be done ? 3. Should i have to need to write my own server code that manages all these server side stuff for push notification? If yes then give me some hint
Hope you will get my points. Thanks
Hi ajaybhojani,
I already answered you both in the forum and by email. Once more, just to clarify. DemoServer is not supposed to be used as a production server solution. You can use one of many libraries (a list of server libraries you can use I already sent you by email) or services (f.e. https://www.pushwoosh.com/, https://www.pubnub.com/, https://onesignal.com, https://parse.com/products/push or https://pushover.net/) to send push notifications. It's up to you to implement server side (using libraries/services documentation and DemoServer just as an example), as it's absolutely project specific thing.
Feel free to ask any specific questions by email to get support as fast as possible.
Best regards, Yuriy, Universal Tools $$anonymous$$m.
Your answer
Follow this Question
Related Questions
Push Notifications iOS & Android Vuforia & UrbanAirship 0 Answers
Push Notifications (to Specific devices) 1 Answer
Remote Settings Unity 2017.2.1f1 Platform Segmentation always return All Current Users 1 Answer
Reading notifications from Unity or knowing if notifications are enabled 0 Answers
Local notification with closed app 3 Answers