0
異なるIDを持つforループで複数の通知をしようとしています。複数のローカル通知をイオニクスで作成するためのヘルプが必要2
私はコードをテストするとき、なぜ1つの通知しか再生しないのですか?他の通知は取り消されました(再生されません)。
この
は、イオンのドキュメントに基づいて、私のコードaddNotifications(){
this.localNotifications.cancelAll();
this.TempExamsList.forEach(e=>{
let notificationTime = new Date();
notificationTime.setFullYear(
parseInt(moment(e.date,"YYYY-MM-DD").format("YYYY")),
parseInt(moment(e.date,"YYYY-MM-DD").format("MM"))-1,
parseInt(moment(e.date,"YYYY-MM-DD").format("DD")));
notificationTime.setHours(parseInt(moment(e.time,"HH:mm").format("HH")));
notificationTime.setMinutes(parseInt(moment(e.time,"HH:mm").format("mm")));
this.localNotifications.schedule({
id: new Date().getUTCMilliseconds(),
title: e.name,
text: "Location: " + e.location + " - Time: " + e.time,
at: notificationTime,
//sound: null,
});
})
this.TempTasksList.forEach(t=>{
let notificationTime = new Date();
notificationTime.setFullYear(
parseInt(moment(t.date,"YYYY-MM-DD").format("YYYY")),
parseInt(moment(t.date,"YYYY-MM-DD").format("MM"))-1,
parseInt(moment(t.date,"YYYY-MM-DD").format("DD")));
notificationTime.setHours(parseInt(moment(t.time,"HH:mm").format("HH")));
notificationTime.setMinutes(parseInt(moment(t.time,"HH:mm").format("mm")));
this.localNotifications.schedule({
id: new Date().getUTCMilliseconds(),
title: t.name,
text: "Time: " + t.time,
at: notificationTime,
//sound: null,
});
})
}