得到通知的关键错误401 GCM https://android.googleapis.com/gcm/googlenotification [英] get notification key error 401 gcm https://android.googleapis.com/gcm/googlenotification
问题描述
即时通讯试图从谷歌服务的IM以下从 HTTP文件通知关键:// developer.android.com/google/gcm/notifications.html 并即时生成客户端上的一个重要的通知但与POST请求得到错误401确定的一个问题IM
im trying to get notification key from google service im following the documentation from http://developer.android.com/google/gcm/notifications.html and im Generating a Notification Key on the Client but im having a problem with the post request getting error 401 OK
{
"operation": "create",
"notification_key_name": "vitee",
"registration_ids": ["********"]
"id_token": "**************************************************"
}
这里是我的要求快照
here is a snapshot of my request
![请在此输入图片说明] [1]
![enter image description here][1]
<一个href="https://lh5.googleusercontent.com/QmTDFWwjkyPtLFVVcTN4IYwkVhHU42wcUKPjpg_E8KSR3ALAXJ2Js-0K2gzlmmOEUXfrGe1TS8s=w1890-h820" rel="nofollow">https://lh5.googleusercontent.com/QmTDFWwjkyPtLFVVcTN4IYwkVhHU42wcUKPjpg_E8KSR3ALAXJ2Js-0K2gzlmmOEUXfrGe1TS8s=w1890-h820
推荐答案
如果您正在创建您的客户端上的用户通知,则不能使用创造的操作。使用添加来代替。正如所提到的文件中,增加创建,如果它不存在的通知键
If you are creating a user notification on your client, you cannot use the "create" operation. Use "add" instead. As mentioned in the documentation, "add" creates the notification key if it doesn't exist.
在生成 id_token
,确保你在你的范围指定客户端ID(非API密钥)
对象。
In generating the id_token
, make sure that you specify the client ID (not API key) in your scope
object.
这篇关于得到通知的关键错误401 GCM https://android.googleapis.com/gcm/googlenotification的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!