问题描述
我尝试使用“cordova-plugin-fcm-with-dependecy-updated”插件在我的应用程序中实现推送通知。要在应用程序处于前台时获取系统托盘中通知消息的通知,我使用了“本地通知”。现在,当我发送通知消息时,它可以在应用程序处于前台时在系统托盘和横幅中显示通知。但是当应用程序在后台时,我只会在系统托盘中收到通知。横幅通知不再显示。任何人都可以请帮忙吗? 下面是我的 onNotification 代码。
this.fcm.onNotification().subscribe((payload) => {
if (payload.wasTapped) {
this.pushPayload = payload;
console.log("onMessage Received on tap "+JSON.stringify(this.pushPayload));
} else {
this.pushPayload = payload;
console.log("onMessage Received without tap "+JSON.stringify(this.pushPayload));
let notiValue: string = this.pushPayload["param1"];
this.localnotifications.schedule({
id: this.id,text: 'Single background Local Notification'+notiValue,data: { secret: notiValue }
});
this.id++;
}
});
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)