[問題] gcm REGISTERED DEVICE ID要在哪看呢?

看板AndroidDev作者 (wade)時間10年前 (2015/08/02 19:28), 編輯推噓1(104)
留言5則, 2人參與, 最新討論串1/1
因為新版的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://www.ptt.cc/bbs/AndroidDev/M.1438514886.A.6D7.html

08/02 19:46, , 1F
找到了 在官方程式RegistrationIntentService裡面的
08/02 19:46, 1F

08/02 19:46, , 2F
57行 有用Log印出GCM Registration Token:
08/02 19:46, 2F

08/02 19:48, , 3F
08/02 19:48, 3F

08/02 20:50, , 4F
用 parse 比較簡單
08/02 20:50, 4F

08/02 21:22, , 5F
可是我沒有要使用到parse服務呢
08/02 21:22, 5F
文章代碼(AID): #1LlVx6RN (AndroidDev)