【发布时间】:2019-05-14 10:32:12
【问题描述】:
我已成功在 Android 上设置 phonegap-push-plugin - 我能够接收来自 FCM 的消息。当我启动应用程序并收到一条消息时,我的自定义图标会显示在状态栏中..太棒了!
但是,当应用程序尚未启动并收到消息时,图标默认返回白色方块。
插件:
phonegap-version cli 8.0.0
phonegap-plugin-push v2.1.3
应用启动时使用的代码:
const push = PushNotification.init({
android: {
senderID: "418827009056",
sound: "true",
vibrate: "true",
icon: "notification",
iconColor: "#002060",
clearBadge : true,
},
browser: {
pushServiceURL: 'http://push.api.phonegap.com/v1/push'
},
ios: {
alert: "true",
badge: "true",
sound: "true"
},
windows: {}
});
config.xml 中是否有办法为推送通知添加默认图标但应用程序已启动?
【问题讨论】:
-
你在
icon: "notification"中提到的名字必须与android图标名称相同 -
可能..但是如何在 config.xml 文件中设置我的自定义图标?
标签: android push-notification icons phonegap