[英]Default push-notification white square before app is loaded
我已經成功地在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中是否有一種方法可以為推送通知添加默認圖標,但應用程序已啟動?
在AndroidManifest.xml
使用此代碼:
<application>
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_notification" />
<application />
如FCM android文檔中所述,如果您不需要在通知響應中發送圖標名稱或者無法獲取名稱。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.