он - пример кода, который я использую в моем app.component.ts для регистрации и получения уведомлений pu sh, после запуска я вижу свой регистрационный идентификатор, но не могу получить уведомления pu sh
initPushNotification() {
let _this = this
const options: PushOptions = {
android: {
senderID: "1xxxxxxxxxx7x"
},
ios: {
alert: 'true',
badge: true,
sound: 'false'
}
};
const pushObject: PushObject = _this.push.init(options);
pushObject.on('notification').subscribe((notification: any) => {
console.log('Received a notification', notification)
if (notification.additionalData.foreground) {
let confirmAlert = _this.alertCtrl.create({
title: notification.title,
message: notification.message,
buttons: [{
text: 'Cancel',
role: 'cancel'
}, {
text: 'View',
handler: () => {
console.log("reached view acccept")
}
}]
});
} else {
console.log("reached via background")
}
});
pushObject.on('registration').subscribe((registration: any) => {
console.log(registration)
localStorage.setItem("registration",
registration.registrationId)
});
}