Ionic FirebasePush通知已收到但未在IOS上显示

时间:2019-07-10 09:32:02

标签: ios firebase ionic-framework push-notification ionic3

我正在通过Firebase云消息传递发送推送通知。在android上,它可以正常工作,但在ios上却不能。在Xcode控制台上,我看到已收到消息,但未显示任何内容。在iPhone上,当我进入应用程序设置时,找不到通知页面。 我已经设置了所有证书

这是xcode控制台


2019-07-10 11:30:39.866130+0200 MyApp[645:69233] Connected to FCM.
2019-07-10 11:30:39.870450+0200 MyApp[645:69233] InstanceID token: c3AZIIkBL_Y:APA91bHMXXXXXXXXXXtSP_qSOQVNXXXXXXXX2fBamwc-2YivcH6gz-88CX725_lAqmu9Zyh278CWnqmGYZVdirieAUThg8Du
2019-07-10 11:30:39.925308+0200 MyApp[645:69277] [Fabric] failed to download settings Error Domain=FABNetworkError Code=-5 "(null)" UserInfo={status_code=403, type=2, request_id=08152abdXXXXXXXXXX, content_type=application/json; charset=utf-8}
2019-07-10 11:30:40.663770+0200 MyApp[645:69233] Ionic Native: deviceready event fired after 649 ms
2019-07-10 11:30:53.887736+0200 MyApp[645:69233] Received data message: {
    "collapse_key" = "com.XXXXXXXX";
    from = 45610XXXXX;
    notification =     {
        body = test;
        e = 1;
        tag = "campaign_collapse_key_52733XXXXXXX";
        title = prova;
    };
}

我的代码

async getToken(user) {
    let token;
    if (this.platform.is('android')) {
      token = await this.firebase.getToken();
    }

    if (this.platform.is('ios')) {
      token = await this.firebase.getToken();
      await this.firebase.grantPermission();
    }

    this.saveToken(token, user);
  }

0 个答案:

没有答案