I’m confused about the implementation of the cloud push notifications. I want to use them without using any of the other cloud game features.
So I use this code to register the device:
local coronacloud = require “corona-cloud-core”
coronacloud.init(cloudaccesskey,cloudsecretkey)
coronacloud.registerDevice(event.token)
OK, fine, so now a bunch of devices are registered
Now, I’m confused about how to send the actual push message. Yes, I know you
do it with PHP and curl. But the example doesn’t offer much explanation, and only says:
String. Authentication Token of user.
String. Message to be sent.
curl --user bd62f3256a0ff879595e0aa7c0376e9d21b46590:078e95efd0686725b6b10bd8769bc6f767e0183b -X POST -d “auth_token=4f705899f903950001000016&message=hello” https://api.coronacloud.com/notification.json
I don’t understand what the auth_token is or where it comes from.
I assume that the cloud is saving all the devices somewhere so that with one php send command I can use the cloud to send a messaage to ALL devices that were previous registered, correct? I assume I don’t still have to save auth_tokens gathered from each device when they were registered, right? If that was true what would be the point of having the cloud?
So then, what is the auth_token, and how do you get it? I think the items after the --user are cloudaccesskey:cloudsecretkey but I have no idea what the auth_toke is.
Does anybody have an example of the exact PHP code used to send ALL registered devices a push message using Corona Cloud?