-2
我在本文檔http://developer.android.com/google/gcm/client.html的幫助下編寫了推送通知示例。它在4.x設備上工作,而不是在2.3.3設備上工作。推送通知不能在2.3.3上工作並在4.x設備上工作
這裏是我的權限:
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<permission
android:name="com.example.testing.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.testing.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="com.google.android.c2dm.permission.REGISTRATION" />
<receiver
android:name="com.example.testing.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.example.testing" />
</intent-filter>
</receiver>
<service android:name=".GcmIntentService" />
你在2.3.3設備上出現什麼錯誤?發佈你的Logcat – Jimi
你能否更精確地得到你的錯誤?這就像是說「我的應用程序不工作,出了什麼問題?」 onReceive()中的 – user1940676
字符串messageType = gcm.getMessageType(intent);總是返回null。 –