2011年3月21日 星期一

push by Urban Airship

API reference:
http://urbanairship.com/docs/push.html

利用curl發送broadcast
curl -X POST -u "abcd:defg" -H "Content-Type: application/json" --data '{"aps":{"alert":"hello"}}' https://go.urbanairship.com/api/push/broadcast/
說明:
abcd是app key, defg是app master secret

利用curl發送push:
curl -X POST -u "abcd:defg" -H "Content-Type: application/json" --data '{"device_tokens":["BDD076692A89126ED3C5EA057F7C253534807D6F30C04FB67F01FCDD5BDDCB7B"] , "aps":{"alert":"hello"}}' https://go.urbanairship.com/api/push/
說明:
BDD076692A89126ED3C5EA057F7C253534807D6F30C04FB67F01FCDD5BDDCB7B is device token

在iOS device上使用urban airship提供的library
reference:
http://urbanairship.com/docs/apns_test_client.html

沒有留言:

張貼留言