Push-уведомление Firebase не работает в ios, даже если уведомление pu sh включено и ключ авторизации APN загружен в консоль firebase - PullRequest
0 голосов
/ 23 апреля 2020

он - пример кода, который я использую в моем 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)
    });
}
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...