Firebase 身份验证 iOS 12 无效令牌 [英] Firebase Authentication iOS 12 invalid token

查看:29
本文介绍了Firebase 身份验证 iOS 12 无效令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个通过电话短信验证和重新验证码(无 APNS)使用 Firebase 身份验证的应用程序

I have an App that makes use of Firebase Authentication using phone SMS verification and recaptcha (no APNS)

如果您使用的是 iOS 11.4.1,该应用程序在身份验证过程中运行良好

The App works fine with the Authentication process if you are using iOS 11.4.1

但是,如果您使用的是 iOS 12,则身份验证过程会导致令牌消息无效

However, if you are on iOS 12, then the Authentication process leads to an invalid token message

错误域=FIRAuthErrorDomain 代码=17048 无效令牌."UserInfo={NSLocalizedDescription=无效令牌.,error_name=INVALID_APP_CREDENTIAL}

Error Domain=FIRAuthErrorDomain Code=17048 "Invalid token." UserInfo={NSLocalizedDescription=Invalid token., error_name=INVALID_APP_CREDENTIAL}

目前使用最新的firebase ios SDK 5.9.0最新版本的 xcodeiOS 12最新的 Mac OS Mojave 10.14

currently using latest firebase ios SDK 5.9.0 latest version of xcode iOS 12 latest Mac OS Mojave 10.14

我在 2018 年 6 月(3 个月前)看到了一个较早的问题,但不确定它是否与我们的项目有关https://github.com/firebase/firebase-js-sdk/issues/916

I saw an earlier issue in June 2018 ( 3 months ago ) but not sure if it relates to our project https://github.com/firebase/firebase-js-sdk/issues/916

https://github.com/firebase/firebase-ios-sdk

是否有解决方案或这是 Firebase iOS SDK 错误?

Is there a solution around this or is this a Firebase iOS SDK bug?

推荐答案

在 Firebase 中为 APN 使用 .p12 文件时似乎存在问题.我遇到了同样的问题并解决了它更改 .p8 的 .p12 证书 立即更改此问题,我的应用程序收到短信.

It seems like there's a problem while using the .p12 file for APNs in Firebase. I was facing the same problem and solved it changing the .p12 certificate for the .p8 instantly changing this, my app receives the SMS.

您可以在 Apple Developer 帐户的密钥"部分中生成 .p8 文件,下载文件并将其保存在安全位置.此新密钥还会生成 Firebase 设置中需要的 KeyId.最后,您需要与您的 Apple Developer 帐户相对应的 TeamId,您可以在个人资料"设置中找到它.

You can generate the .p8 file in your Apple Developer account in the section 'Keys' download the file and save it in a safe place. This new key also generates a KeyId that would need in the Firebase settings. Finally you would need the TeamId that corresponds to your Apple Developer account, you can found it in the Profile settings.

希望能帮到你.

这篇关于Firebase 身份验证 iOS 12 无效令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆