Easy Cross-Platform Notifications available now!

1267489--56337--$Screen Shot 2013-06-10 at 11.01.48.png

Hi all!

I am very excited to announce that my first Asset submission has been approved and it is available to everyone to download:

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

Remote notifications in mobile platforms can be a little scary to implement because of all the little details you need to get right to make it work (permissions, certificates, server code and database, client code…)

With Easy Cross-Platform Notifications (ECPN) you will get all the server-side and client side code, a full ‘how to’ guide and a Unity scene example to get you started!

The guide will explain what needs to be done on your project in order to get a truly platform-agnostinc notification service to send messages easily between iOS and android, all sitting comfortably within a Unity application.

What can you potentially do with Remote Notifications (with the help of ECPN)?

  • Send a message to all your app users
  • Let users invite their friends to your app if they are not around
  • Send reminders to users -even let them set it themselves!
  • Possibilities are endless! Messages are received irrespective of whether the user is running your app at the moment or not, so you could even set your own messaging service :stuck_out_tongue:

If you do try it and have any comments, please let me know! For support and suggestions, post here or send me an email to:

carlos.fernandez.musoles (at) gmail.com

Thank you and happy coding!

Updated: Here are some screenshots showing what this package can accomplish.

  1. Unity example scene used to register/unregister current device and to send messages to other devices.

  2. iPhone 4 receiving the push notification sent from the Unity scene

  3. Samsung Galaxy SII (android) receiving the same notification (via Google Cloud Message service)

1267489--56336--$Screen Shot 2013-06-10 at 10.58.49.png

You can also post comments and find all my published work (for the future!) on my blog

So this is a complete package for push notigications for ios and android?

It contains everything you need to set up Remote notifications in both iOS and Android. So yes, it is a complete package :slight_smile:

It should be noted that it’s not a “drag and drop” only solution, due to the nature of notifications in both platforms -permissions and certificates need to be set up, as well as the need of a server running PHP and a MySQL database.

But fear not! The package comes with all the code you will need, a full step-by-step guide on how to set everything up, as well as a demo scene to show how the notifications can be used. It also comes with my full support, should you struggle at any point :stuck_out_tongue:

Go ahead and give it a try!

Cheers,
Carlos.

Pretty excited about this. I was planning on having to roll out my own system and really wasn’t wanting to hassle with it.

Not to the phase of needing this yet but you can definitely expect a purchase from me when I am.

@Burletech: Good to hear! That’s what this package is all about: making the implementation of Remote Notifications as painless as possible :stuck_out_tongue:

do u have apk demo? Very interesting if you have it working.

Sure! I’m sending you a demo on a PM :slight_smile:

Hi, I’m very interested in this product. However all I want to do is set a push notification to show up after 2 hours, from code in the game itself, when it’s not focused. I just want to notify the user when their “energy” has refilled. I don’t understand why the heck a PHP or a database would be needed for this use case. Is it? I don’t need to broadcast messages to all players or anything like that.

@jerotas: perhaps you wouldn’t need remote notifications but local notifications. My package was designed with remote notifications in mind, and that’s why you need a server to store user IDs and send requests to Apple / Google to broadcast a message to multiple users.

You could use it for local notifications as well, registering your own device and instead of sending a message to all, just send to self. It all depends on your user case; from what I read in your post, you want your user to know when he has got their energy back -am I to assume this happens when the user is not using your app, right? If that is the case, who knows when your user gets its energy at 100%? If it is you -your server- then you could use ECPN to notify users periodically when this happens; but if it is like a set period of time -say 2 hours after last execution- then a local notification would be the way to go, as remote notifications are a tad more complicated for this case.

EDIT: After reading your post in another thread, I believe you want a timer set up within the app which will fire the notifications to the user. For local notifications you could use the following:

  • Android: a Service started every time your app quits, running with a timer which will fire a local notifications. You need to write your own java plugin for this.
  • iOS: I am pretty sure you can use the NotificationServices class to set and receive local notifications in iOS devices.

demo works great, purchasing.

@imtrobin: glad to hear! Please let me know what you think, and of course contact me if you have any issues.

Hi Carlos

Can you please

  1. I see for apple, you are sending device uuid. Isn’t that disallowed?
    Apple Will No Longer Approve Apps Using Unique Device Identifier (UDID) Beginning May 1, Must Also Support iPhone 5 and Retina Display - MacRumors

  2. Something of a wish, most of the time. the client does not send the notification but rather the server. If you can make so it tracks the app since last launch, and server can send a notification (we can customize) that would be great.

Hi imtrobin,

Not really, push notifications make use of the device Token, which is different from the UDID -so you are safe!
reference

I’m not sure what you are asking here; notifications are ALWAYS sent by your server, on request from the user. The way it works is: the user requests its device to be registered – Apple / Google send the device token to the user – the user sends the token to your server – the server stores it for future references; then, when the user wants to send a message to anyone (or someone) it sends a request to your server – your server collates all information (i.e. device tokens) and sends the final request to Apple / Google – Apple / Google sends directly a notification to the list of devices.

Sorry if I misunderstood.

EDIT: For question number 1, if you are talking about the example scene using the Unity ID -which may be the UDID for iOS devices, I don’t know- don’t worry, this is only an arbitrary identifier. In your projects, you can substitute this for ANY other unique identifier you may come up to differentiate users from each other. In a game I’m working on, I use their username instead.

Notification messages are independent from what you use as identifier, this only serves the purpose of matching a device Token and a user; in other words, if one user wants to send a message to a particular friend, he will only know the identifier [for example ‘John01’], so he will send a request to your server like ‘send a message to John01’]; your server will then look in its tables for John01’s device Token and will use the latter to send the notification. This is designed that way because users should not need to know other devices’ Tokens.

Cheers.

Hi Carlos

It is an error if you include the android.jar when compiling Unity
compile passes When you delete a android.jar.
android.jar may be deleted?

@m.otsu: you are absolutely right, this is my fault! I forgot to mention it in the instructions -version control fail!

The android.jar serves no purpose at all in unity, the only time you may need it is when you are trying to recompile the GCMJava.jar project -if you are interested in implementing further the android plugin (see section in the manual about recompiling the plugin).

You can safely remove it, or better yet, move it outside your project assets folder -the compilation error will dissapear.

Thanks!

Carlos Thank you for answers.

I’m talking about a cron job which sends periodic notifications to inform users about things to do etc, a little spammy. Most use case of notifications is seldom initiated from user to user, right?

Gotcha now.

Yes, remote notifications are well suited for user-to-user and server-to-user communications. If you want something local to remind your users to get back to your app, or other kind of messages app-to-user, you will be better equipped with local notifications. I am currently finishing up an asset to set timed local notifications, so your app can send messages to the user -even with time delay (whether they are using the app or not).

Fingers crossed, it will get to the Asset Store very soon!

Just keeping everyone posted: I have submitted a new package that helps developers to use local notifications on android projects! Pretty much an android version of NotificationServices class :slight_smile:

As per ECPN, I am finishing an update and will be uploading it soon -nothing dramatic, just polishing the Guide and a couple of things.

Cheers.