我创建了本地通知,并且当应用程序在屏幕上运行,应用程序进入后台或被杀死时,我都无法收到通知
this.platform.ready().then(() => {
let exp = new Date(this.expiration_date);
let exp_date = new Date(exp);
let today = new Date(new Date(exp));
let data = moment(exp).format('YYYY/MM/DD');
let data2 = moment(today).format('YYYY/MM/DD');
var d = new Date(this.expiration_date.replace(/-/g, '/'));
console.log(d);
if (data == data2) {
this.localNotifications.schedule({
id: 1,
title: 'myGym',
text: 'Your subscription will expire today',
trigger: {at: d},
});
}
});