作者dwadefans (wade)
看板AndroidDev
标题[问题] gcm REGISTERED DEVICE ID要在哪看呢?
时间Sun Aug 2 19:28:01 2015
因为新版的GCM改过许多
以前旧版的程式跟现在差了许多
而且Google平台上的操作方式也不同
https://developers.google.com/cloud-messaging/android/client
我照着上面的方式做完了 也有成功push notification在手机端
不过我想要使用GCM HTTP connection
https://developers.google.com/cloud-messaging/
send的网页是
https://gcm-http.googleapis.com/gcm/send
还有设定key 但是只有device id 我不知道该去哪看
https://developers.google.com/cloud-messaging/http
上面这网页的「Checking the validity of an API key」部分
使用curl 来 send message
=======================================================
# api_key=YOUR_API_KEY
# curl --header "Authorization: key=$api_key" \
--header Content-Type:"application/json" \
https://gcm-http.googleapis.com/gcm/send \
-d "{\"registration_ids\":[\"ABC\"]}"
=======================================================
这段要给apikey与registration_ids(置换掉ABC)
不过不知道怎麽操作...
另外在github上找到一个用php push message的程式
https://github.com/mattg888/GCM-PHP-Server-Push-Message
一直对於那所谓的device registion id (registration_ids) 不了解
求神人解答感谢 :D
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 115.43.23.4
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/AndroidDev/M.1438514886.A.6D7.html
1F:→ dwadefans: 找到了 在官方程式RegistrationIntentService里面的 08/02 19:46
2F:→ dwadefans: 57行 有用Log印出GCM Registration Token: 08/02 19:46
4F:推 ckvir: 用 parse 比较简单 08/02 20:50
5F:→ dwadefans: 可是我没有要使用到parse服务呢 08/02 21:22