Hi,
i’m trying to use nativ push (https://ionicframework.com/docs/native/push/)
I do this :
const options: PushOptions = {
android: {},
ios: {
alert: 'true',
badge: true,
sound: 'false'
},
windows: {},
browser: {
pushServiceURL: 'http://push.api.phonegap.com/v1/push'
}
};
const pushObject: PushObject = this.push.init(options);
pushObject.on('registration').subscribe((registration: any) => {
console.log('Device registered', registration)
var oldRegId = localStorage.getItem('registrationId');
if (oldRegId !== registration.registrationId) {
// Save new registration ID
localStorage.setItem('registrationId', registration.registrationId);
// Post registrationId to your app server as the value has changed
}
});
pushObject.on('error').subscribe(error => console.error('Error with Push plugin', error));
pushObject.on('notification').subscribe((notification: any) => {
console.log('notification event');
});
i never see notification event
in my console only :
[Log] We have permission to send push notifications (cordova.js, line 1731)
[Log] Device registered – {registrationId: "da82e56c064b763fea6010d3265a5b8199fca5dc8233f4d4acf5371f2d422484", registrationType: "APNS"} (cordova.js, line 1731)
What i’m doing wrong ?