我验证该应用程序可以在galaxy nexus平板电脑(4.2)和三星galaxy s3手机(4.1.1)上接收通知,但不能在三星galaxy tab 10.1(4.0.4)和三星7英寸平板电脑(4.0.4)上运行
有多个 Google 帐户登录到平板电脑。我收到了注册 ID,在发送通知时出现错误
错误日志,
05-22 14:40:47.220: W/GTalkService(10357): [DataMsgMgr] broadcast
intent callback: result=CANCELLED forIntent {
act=com.google.android.c2dm.intent.RECEIVE cat=[ xxx ] (has extras) }
05-22 14:40:47.225: W/GTalkService(10357): Receiver package not found,
unregister application com.myapp.example sender
Android清单具有所有必要的权限
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- Only this application can receive the messages and registration result -->
<permission android:name="com.myapp.example.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.myapp.example.permission.C2D_MESSAGE" />
<receiver
android:name="com.myapp.example.gcm.GCMReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.myapp.example.gcm" />
</intent-filter>
</receiver>
<service android:name=".gcm.GCMService" />