2010-10-06 173 views

回答

0

As per the footnote at the bottom of this link.它最多應該是1024個字節。如果您使用的是Java,這也不應該擔心。

private void handleRegistration(Context context, Intent intent) 
{ 
     String registration = intent.getStringExtra("registration_id"); 
     .... } 

[編輯]

像特雷弗說,最大的尺寸應該是一個cookie的大小。 (4096字節)

+1

我認爲,消息的大小限制(在鏈接處)用於推送消息。這只是推定,註冊ID具有相同的限制。 – Lepi 2011-11-20 15:15:36

+0

呃,你是對的,爲Google工作的Trevor有正確的答案。 – Reno 2012-04-02 16:58:36

2

根據This thread結果變化(給出98和120),但海報建議在數據庫中放置255,這就是我要做的。

9

registration_id的最大尺寸受Cookie大小的限制,即4K(4096字節)。

實際上,代幣將比這個小得多,但是你不應該依賴這種行爲。

(該registration_id不被認爲是有效載荷的一部分,所以提到過的腳註雷諾在這裏並不適用。)

來源:在谷歌我在Android團隊。 :)
(我很快就會更新文檔,使這個更清晰,因爲最近有幾個人問。)

+0

你好,如果你有時間,請在這裏檢查我的問題關於registrationId模式:http://stackoverflow.com/questions/12403628/is-there-a-gcm-registrationid-pattern – 2012-09-13 09:51:35