Android的GCM未经授权的401错误用PHP [英] Android GCM Unauthorized 401 error with PHP

查看:971
本文介绍了Android的GCM未经授权的401错误用PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我的GCM推送消息通知没有工作了。
我没有改变什么,我在谷歌API控制台,我registred我的专用服务器的IPv6,如果白名单中的IP地址。

Recently my GCM push message notification didn't work anymore. I didn't change anything, in my Google API Console, I've registred the IPV6 of my dedicated server if the whitelist IP address.

但是,当我试图达成GCM服务,我总是得到一个错误:

But when I try to reach GCM service I always get an error :

未经授权

错误401

另外随着IPV4尝试没有成功...

Also tried with IPV4 without success...

我已经尽我自己的电脑上相同的脚本,一切工作顺利...

I've tried the same script on my own computer and everything works smooth ...

任何想法将是非常美联社preciate:)

Any idea would be very appreciate :)

感谢您的帮助。

推荐答案

您需要把服务器的IP地址白名单中的IP地址在谷歌API控制台GCM。

You need to put the server IP address in the whitelist ip addresses in google api console for GCM.

编辑:
您必须使用服务器应用程序键(与IP锁定),而不是浏览器的关键。

you must use Key for server apps (with IP locking) instead of browser key.

这篇关于Android的GCM未经授权的401错误用PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆