2012-10-17 233 views
0

我試圖爲我的android應用程序設置城市飛艇,但我無法獲得Google C2DM令牌。或許,我在按照Urban Airship Doc使用C2DM之前這樣做。Google C2DM授權令牌

命令行(位於「工具」目錄中的分佈zip文件)

當我運行我在Mac OS X獅子終端上的文件,我得到這個在

-Run「clientauth.py」錯誤。 有人可以幫我解決這個問題嗎?先謝謝你!

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 

回答

1

在您花費太多時間在此之前,C2DM已被棄用。您應該使用Google Cloud MessagingAndroid developer website上有一個遷移指南。

+0

好..我被折舊的數據之前接受.. – etrademom

+0

你仍然不應該使用它了。這就是爲什麼他們貶低東西,他們希望你現在使用GCM,這就是他們將要支持和開發的東西。 C2DM不再被開發,並最終被完全移除。 – Ralgha

+0

好..很高興知道,謝謝 – etrademom