У меня проблемы с моим проектом.phonegap-push-plugin не работает в iOS
У меня есть Ионный проект, и я использую pushgog-push-push для отправки push-уведомлений. На Android работает хорошо, но на iOS не работает. Не появляется предупреждение о том, хочу ли я получать уведомления, и событие регистрации не выполняется.
Что не так?
Заранее спасибо.
Вот мой код:
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);
});
}
Вот моя консоль:
`>>>>>> DEVICE READY <<<<<<
>>>> HandleNotificationReady <<<<
>>> iOS, nice to meet you!`
Спасибо за ваш ответ! Я понял, что плагин не идет в Ionic Cloud Service. Повторное создание проекта, вероятно, решит проблему. – eliangela