gpt4 book ai didi

java - Android 解析推送

转载 作者:行者123 更新时间:2023-11-30 01:40:25 25 4
gpt4 key购买 nike

我正在使用 Parse 服务向设备发送推送消息。在 iOS 上一切正常,但在 Android 上,如果我发送推送消息,它会向接收者显示我的包名称(“com.example.app”)。为什么它不显示我的应用程序名称(“示例应用程序”)? enter image description here谢谢。

最佳答案

你应该再检查一下你的源代码,我按照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);

关于java - Android 解析推送,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34579511/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com