【发布时间】:2016-05-10 12:56:18
【问题描述】:
Android Gcm onMessage().. 在某些设备上收到“null”,例如“Android 4.4 LG GPad 1.0”和“Android 6.0 Lg G4”.. 但在某些设备中,Gcm 会收到正确的消息,例如“Android 5.1 Samsung J5 and J2”...... 我无法解决的问题是什么...... 这是代码...
protected void onMessage(Context context, Intent intent) {
Log.i(TAG, "Received message");
//Bundle extras = intent.getExtras();
String message = intent.getExtras().getString("message");
<receiver
android:exported="true"
android:name="com.google.android.gcm.GCMBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action droid:name="com.google.android.c2dm.intent.REGISTRATION"/>
<category android:name="com.xtravoapps.premierdocfinder" />
</intent-filter>
</receiver>
<service android:name="MYPACKAGENAME.GCMIntentService" />
【问题讨论】:
-
你到底想达到什么目的?
-
我想在所有 android 移动设备上看到我的 gcm 通知.....但是通知接收到一些设备......而一些设备接收到“null”......为什么
-
发布更多代码 sn-ps。您的完整接收者、完整清单、您发送的有效负载。如果我们能看到这些将会很有帮助。 :) 干杯!
标签: android push-notification google-cloud-messaging android-notifications