我开始将 Firebase Cloud Messaging 连接到 Ionic + Angular,但是当我调用方法时,const token = await this.firebase.getToken();
我什么也没得到。应用程序继续工作,但我仍然没有得到令牌。完整代码:
async getToken() {
const hasPermission = await this.firebase.hasPermission();
if (Capacitor.getPlatform() === 'ios' && !hasPermission) {
await this.firebase.grantPermission();
}
const token = await this.firebase.getToken();
this.saveToken(token);
}
我将 GoogleService-Info.plist 添加到我的应用程序的根目录:
此外,在我的 firebase 帐户中,我已经上传了我的APNs Auth Key并在 AppleDeveloper Acc 上创建了证书。Apple、Application 和 Firebase 中的应用程序标识符相同。
我做错了什么?