Android解析推送

Android Parse Push

我正在使用 Parse 服务向设备发送推送消息。 在 iOS 上一切正常,但在 Android 上,如果我发送推送消息,它会向接收者显示我的包裹名称 ("com.example.app")。为什么它不显示我的应用名称 ("Example App")? 谢谢

你应该再检查一下你的源代码,我按照Parse Document 运行正常,你可能发送了错误的标题内容

Intent intent = new Intent(context, ZHSplashActivity.class);
    PendingIntent pIntent = PendingIntent.getActivity(context, (int) System.currentTimeMillis(), intent, 0);
    Notification n  = new Notification.Builder(context)
            .setContentTitle(context.getResources().getString(R.string.app_name))
            .setContentText(message)
            .setSmallIcon(R.drawable.app_icon)
            .setContentIntent(pIntent)
            .setAutoCancel(true).build();

    NotificationManager notificationManager =
            (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);

    notificationManager.notify(0, n);