Push Notification Question

I have not really used push notifications yet, nut I was wondering is it possible with Corona to send a push notification to an individual user or device ID, instead of everyone who has the app?

Thanks!

@kRona, as far as I am aware, push notifications are sent to each specific device ID.  I don’t think there’s any pre-existing API call that would send push notifications to all device with the app.  To do that, I think you’d need to custom code a web service with a database that saves device ID of all users and send a notification to each and every device ID in the database.

That said, if I’m mistaken and if there’s a simpler way to send notifications to all users, I’d like to know.

Naomi

The way push works is your push service sends your message along with a list of ID’s to receive the message to Apple and Google’s servers.  They verify that those devices are set to receive messages from your app and then they broadcast the message out.   Corona Cloud (though it’s going away soon) can send push messages to just people involved in a game which could just be the person who’s turn it is, so yes, it can send to just one ID.

That said most services like PushWoosh, Urban Airship and such are really designed to broadcast to all ID’s that they know about (well UA can do segments, but…) 

If you build your own service to send push messages, you have to register the device ID’s in your own database and how you slice and dice that list to send to is up to you.   There is an old blog post on iOS push notifications (Dec 2011) that shows how to setup a small PHP script to register and send messages.  There is a publicly available PHP package called EasyAPNS that if you have a PHP/MySQL web host can be used to send messages too.

@kRona, as far as I am aware, push notifications are sent to each specific device ID.  I don’t think there’s any pre-existing API call that would send push notifications to all device with the app.  To do that, I think you’d need to custom code a web service with a database that saves device ID of all users and send a notification to each and every device ID in the database.

That said, if I’m mistaken and if there’s a simpler way to send notifications to all users, I’d like to know.

Naomi

The way push works is your push service sends your message along with a list of ID’s to receive the message to Apple and Google’s servers.  They verify that those devices are set to receive messages from your app and then they broadcast the message out.   Corona Cloud (though it’s going away soon) can send push messages to just people involved in a game which could just be the person who’s turn it is, so yes, it can send to just one ID.

That said most services like PushWoosh, Urban Airship and such are really designed to broadcast to all ID’s that they know about (well UA can do segments, but…) 

If you build your own service to send push messages, you have to register the device ID’s in your own database and how you slice and dice that list to send to is up to you.   There is an old blog post on iOS push notifications (Dec 2011) that shows how to setup a small PHP script to register and send messages.  There is a publicly available PHP package called EasyAPNS that if you have a PHP/MySQL web host can be used to send messages too.