Good afternoon everyone!
I have an IONIC project where I'm using the phonegap-plugin-push to send push notifications. On Android is working very well, but on iOS does not work. Alert does not appear asking if I want to receive notifications and the Registration Event does not run.
I have already enabled Push Notifications in Apple Developer, I am using the correct Provisioning and the correct P12 Certificates.
My code is this:
document.addEventListener('deviceready', function() {
console.log('>>>>>> DEVICE READY <<<<<<');
handleNotificationReady();
});
function handleNotificationReady(){
console.log('>>>> HandleNotificationReady <<<<');
var pushNotification;
if (device.platform == 'Android') {
console.log('>>> Android, nice to meet you!');
pushNotification = PushNotification.init({
android: {
senderID: '6610***',
icon: 'icon'
}
});
} else if (device.platform == 'iOS') {
console.log('>>> iOS, nice to meet you!');
pushNotification = PushNotification.init({
ios: {
alert: 'true',
badge: 'true',
sound: 'true'
}
});
}
pushNotification.on('registration', function(data) {
console.log('>>>> REGISTRATION <<<<');
console.log(data.registrationId);
});
pushNotification.on('notification', function(data) {
console.log('>>>> NOTIFICATION <<<<');
console.log(data);
});
pushNotification.on('error', function(err) {
console.log('>>>> ERROR <<<<');
console.log(err);
});
}
And the console:
'>>>>>> DEVICE READY <<<<<<
>>>> HandleNotificationReady <<<<
>>> iOS, nice to meet you!'
According to the log, it runs INIT, but it does not get to Registrar.
Someone knows tell me what's wrong.
Thank you!