Я получу событие push-уведомления в фоновом режиме, но нигде не могу найти ответ.Действительно ли возможно получить событие уведомления в фоновом режиме, когда я работаю с ionic?Вот некоторые фрагменты кода моего проекта.
const options: any = {
android: {
senderID: '1066246698789'
},
ios: {
alert: 'true',
badge: true,
sound: 'false',
clearBadge: true
},
windows: {},
browser: {
pushServiceURL: 'http://push.api.phonegap.com/v1/push'
}
};
this.pushObject = this.push.init(options);
// console.log('helper ', nav);
this.pushObject.on('notification').subscribe((notification: any) => {
alert(notification);
// console.log(notification);
this.badge.increase(1);
if (nav) {
// console.log("this.nav is not null");
this.processNotification(notification, nav, this)
}
else {
// console.log("this.nav is null");
}
});
В настоящее время, когда приложение находится в фоновом режиме, this.pushObject.on ('Notification') не запускается.