【发布时间】:2012-10-17 23:02:16
【问题描述】:
我正在尝试为我的 Android 应用设置城市飞艇,但在获取 Google C2DM 令牌时遇到了问题。 也许,根据 Urban Airship Doc,我在使用 C2DM 之前正在这样做。
-在命令行上运行“clientauth.py”(位于分发zip文件的“tools”目录中)
当我在 Mac OS X Lion 的终端上运行该文件时,我收到此错误。 有人可以帮我解决这个问题吗?提前谢谢!
MacBook-Pro:~ me$ python /Users/me/Documents/ua-android-lib-latest/tools/clientauth.py
C2DM Google Account: my google email for c2dm
Password for my google email for c2dm:
Traceback (most recent call last):
File "/Users/me/Documents/ua-android-lib-latest/tools/clientauth.py", line 46, in <module>
ClientLoginTokenFactory().getToken()
File "/Users/me/Documents/ua-android-lib-latest/tools/clientauth.py", line 34, in getToken
response = urllib2.urlopen(request)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
response = meth(req, response)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 438, in error
return self._call_chain(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 521, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden
【问题讨论】:
标签: android python android-c2dm urbanairship.com