Firebase 应用检查/应用证明内部错误 - iOS

Firebase App Check / App Attest Internal Error -iOS

提问人:Lance Samaria 提问时间:11/4/2023 最后编辑:Lance Samaria 更新时间:11/10/2023 访问量:55

问:

使用 Xcode 并运行我的应用程序时,我可以通过 App Check/App Attest 执行以下操作来访问 Firebase:

let providerFactory = AppCheckDebugProviderFactory()
AppCheck.setAppCheckProviderFactory(providerFactory)

一旦我得到.我手动将令牌添加到 FirebaseFirebase App Check debug tokenConsole > App Check

但是当我将我的应用上传到 App Review 时,他们无法登录,他们收到错误代码

17999 - 内部错误

为什么通过 App Check / App Prove 使用 Firebase,Firebase 在生产/上线时无法访问?

我采取了以下步骤:

我更新到最多.recent pods

Firebase 控制台中

App Check > Apps > AppAttest> 已注册并添加了我的团队 ID。 令牌生存时间设置为 1 小时(默认) >Save

AppDelegate 中:

import FirebaseAppCheck

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    override init() {
        super.init()
        
        Messaging.messaging().delegate = self
        
        let providerFactory = YourAppCheckProviderFactory()
        AppCheck.setAppCheckProviderFactory(providerFactory)
        
        FirebaseApp.configure()
    }
}

class YourAppCheckProviderFactory: NSObject, AppCheckProviderFactory {
  func createProvider(with app: FirebaseApp) -> AppCheckProvider? {
    return AppAttestProvider(app: app)
  }
}

Xcode 中:

Edit Schemes > Run > Arguments > FIRDebugEnabled已选中

从 > > > > > 下载了最新的 Google-Info.plist 用最新的替换了我项目中的上一个Firebase ConsoleProject OverviewProject SettingsGeneralApple apps

Targets > Signing & Capabilities>添加App Attest

Entitlements File > App Attest Environment : production

Google Cloud Console 中:

Credentials > Key Restrictions : None > API restrictions : Don't restrict keys

APIs & Services > Library > Token Service API:enabled

在 developer.apple.com 中:

Certificates, IDs & Profiles > Certificates > Keys>创建了一个Device Check key

图片(适用于可能遇到此问题的其他人):

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

iOS Swift 商店连接 Firebase-应用检查

评论


答:

0赞 Lance Samaria 11/4/2023 #1

出现此问题的原因是我的 Firebase Pod 已过时。他们在 8.15.0 上,而他们应该在当前版本上,即 10.17.0

要检查您的 pod 版本,请转到应用的主文件夹,打开终端,cd 到该文件夹,然后运行 或 并检查您的 firebase pod 版本。要更新,请运行open -a TextEdit Podfile.lockvim Podfile.lockpod outdatedpod update