Проблема с мобильным Oneplus 3T в push-уведомлениях - PullRequest
0 голосов
/ 01 декабря 2018

У меня проблема с push-уведомлением.Я не получаю уведомления в OnePlus 3T, но в другом мобильном телефоне работает.Мой код указан ниже.

app.component.ts

platform.ready (). Then (() => {

statusBar.styleDefault ();

splashScreen.hide ();

this.initPushNotification ();

});

initPushNotification () {

this.push.hasPermission ()

.then ((res: any) => {

if (res.isEnabled) {

console.log ('У нас есть разрешение на отправкуpush-уведомления ');

} else {

console.log (' У нас нет разрешения на отправку push-уведомлений ');

}

});

const options: PushOptions = {

android: {

senderID: 'xxxx'

},

ios: {

предупреждение: «истина»,

значок: истина,

звук: «ложь»

}

};

const pushObject: PushObject = this.push.init (options);

pushObject.on ('Notification'). Subscribe ((Notification):)«Получено уведомление», notification));

pushObject.on ('регистрация'). подписаться ((регистрация: любая) => {

console.log ('устройство зарегистрировано, регистрация);

// alert (JSON.stringify (регистрация));

this.hmService.saveDeviceToken (registration.registrationId)

.then (data => {

console.log (data);

})

.catch (error => {console.log ('error push registration')});

});

pushObject.on («ошибка»). Подписаться (error => console.error («Ошибка с Push-плагином», ошибка));

}

Пожалуйста, помогитея.

...