推送自定义消息为空,通知正常,为什么?

L_X_P
8年前 2.1k 0

接收自定义消息的代码:else if (JPushInterface.ACTION_MESSAGE_RECEIVED.equals(intent.getAction())) {
Log.d(TAG, "[MyReceiver] 接收到推送下来的自定义消息: " + bundle.getString(JPushInterface.EXTRA_MESSAGE));
int notifactionId = bundle.getInt(JPushInterface.ACTION_MESSAGE_RECEIVED);
Log.e(TAG, "[MyReceiver] 接收到推送下来的通知的ID: " + notifactionId);
processCustomMessage(context, bundle);

    }

private void processCustomMessage(Context context, Bundle bundle) {
String title = bundle.getString(JPushInterface.EXTRA_NOTIFICATION_TITLE);
Log.e(TAG, " title : " + title);
String message = bundle.getString(JPushInterface.EXTRA_ALERT);
Log.e(TAG, "message : " + message);
String extras = bundle.getString(JPushInterface.EXTRA_EXTRA);
Log.e(TAG, "extras : " + extras);
}
接收的结果:
04-20 16:35:50.410: I/JPush(29472): This message has no Extra data
04-20 17:09:18.530: E/JPush(7923): [MyReceiver] 接收到推送下来的通知的ID: 0

04-20 16:35:50.410: E/JPush(29472): title : null

04-20 16:35:50.410: E/JPush(29472): message : null

04-20 16:35:50.410: E/JPush(29472): extras :
但是明明显示推送成功了

1个回答

热门排序
  • jiminy
    8年前

    你提问信息不全,请重新编辑问题补充以下信息:
    1.你收到记录的msgid;
    2.你获取自定义消息的内容的代码。