On Mon, Feb 24, 2014 at 6:36 PM, Miguel Lemos <miguel21op@gmail.com> wrote:
That would be neat if  I understand a simple way to send a  push to a particular dude's phone. So far I've not yet understood how...


use an alias that is unique (E.g. the user-id in your backend):
curl -3 -u "{variantID}:{secret}"
    -v -H "Accept: application/json" -H "Content-type: application/json" 
    -X POST
    -d '{
      "deviceToken" : "someTokenString",
      "alias" : "myUniqueString"
     }'

https://SERVER:PORT/context/rest/registry/device

Now, the above does store this string (the alias ) on the device metadata.


Filter exactly that one device (for user w/ alias myUniqueString) for send:

curl -3 -u "{PushApplicationID}:{MasterSecret}"
     -v -H "Accept: application/json" -H "Content-type: application/json" 
     -X POST
   -d '{
       "alias" : ["myUniqueString"],
       "message": {
           "alert":"HELLO!"
       }
    }'

https://SERVER:PORT/context/rest/sender

NOTE: that the alias is used here (on the send) to filter/query that exact user.

-M

--
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf