Angular 从服务器端接收多个通知
我正在研究离子4和角度。我的应用程序是航班时间表的内容。一切正常。但我想做的是在航班到达时收到当地通知。在我下面的代码中,我想为多个航班发出多个通知。但当我运行应用程序时,我会收到同一航班的多个通知。我如何为多个航班发出多个通知 代码:Angular 从服务器端接收多个通知,angular,server-side,localnotification,Angular,Server Side,Localnotification,我正在研究离子4和角度。我的应用程序是航班时间表的内容。一切正常。但我想做的是在航班到达时收到当地通知。在我下面的代码中,我想为多个航班发出多个通知。但当我运行应用程序时,我会收到同一航班的多个通知。我如何为多个航班发出多个通知 代码: async ActiveNotif() { this.ng.run(() => { setInterval(() => { this.http.get('XXXXXXXXXXXXXXX&flight
async ActiveNotif() {
this.ng.run(() => {
setInterval(() => {
this.http.get('XXXXXXXXXXXXXXX&flight=' + this.id + '', {}, {})
.then(data => {
let FlightDetails = JSON.parse(data.data);
this.identification = FlightDetails.identification.callsign;
this.Fstatus = FlightDetails.status.generic.status.text;
console.log(this.Fstatus)
});
}, 5000)
if (this.Fstatus == "landed") {
this.localNotifications.schedule(
[
{
id:0,
title: 'Your flight has arrived',
text: 'Your flight ' + this.identification + ' is arrived',
trigger: { count: 1 },
sound: "file://assets/one.mp3"
},
{
id:1,
title: 'Your flight has arrived',
text: 'Your flight ' + this.identification + ' is arrived',
trigger:{count:1}
}
]);
}
})
}
很难说没有看到后端。但是只要看看这个代码,
this.id
就会向我扑来。你是不是只通过了一次航班的身份证?@BlairHolmes。是的,我只是把航班号传给url。甚至他也在追踪飞行状态。@BlairHolmes。像我的情况一样,是否可以通过onesignal或firebase消息云推送通知?