Push notification 在iOS上的第一次应用程序启动中未触发注册和注册错误

Push notification 在iOS上的第一次应用程序启动中未触发注册和注册错误,push-notification,firebase-cloud-messaging,ionic4,capacitor,Push Notification,Firebase Cloud Messaging,Ionic4,Capacitor,我使用Firebase FCM、Ionic V4和电容器实现了推送通知。我为Android和iOS构建了应用程序 一切正常,我能够获取和处理推送通知,但iOS应用程序在安装后首次启动时除外,当时,注册和注册错误没有被触发,这就是它在我的项目中的实现方式: const { PushNotifications, } = Plugins; ... // On success, we should be able to receive notifications PushNoti

我使用Firebase FCM、Ionic V4和电容器实现了推送通知。我为Android和iOS构建了应用程序

一切正常,我能够获取和处理推送通知,但iOS应用程序在安装后首次启动时除外,当时,注册和注册错误没有被触发,这就是它在我的项目中的实现方式:

const {
  PushNotifications,
} = Plugins;

...

    // On success, we should be able to receive notifications
    PushNotifications.addListener(
      'registration',
      (token: PushNotificationToken) => {
        this.storageService.setCookie('IID_TOKEN', token.value);
      }
    );

    // Some issue with our setup and push will not work
    PushNotifications.addListener('registrationError', (error: any) => {
      console.log('Error on registration: ' + JSON.stringify(error));
    });
在iOS应用程序启动的第二次和之后的所有时间里,它们都会被毫无问题地调用,每次都在Android上运行(包括第一次)

我唯一的猜测是,当我向用户请求接收推送通知的权限时,这些侦听器在执行时被阻止