简体   繁体   English

Firebase 应用程序检查不适用于 iOS 16

[英]Firebase app check not working with iOS 16

It looks like for my app the firebase app check is not working with iOS16.对于我的应用程序,firebase 应用程序检查似乎不适用于 iOS16。 I have configured the app attest and its been working for more than a year, it's still working with older iOS versions but not iOS 16.我已经配置了应用程序证明,它已经工作了一年多,它仍然可以使用旧的 iOS 版本,但不能使用 iOS 16。

This is the code that I initialise app check这是我初始化应用程序检查的代码

import SwiftUI
import Firebase
import FirebaseAppCheck

@main
struct appointmeparterAppApp: App {
    @Environment(\.scenePhase) var scenePhase
    @UIApplicationDelegateAdaptor(AppDelegate.self) var delegate
    
    init() {
        let providerFactory = YourAppCheckProviderFactory()
        AppCheck.setAppCheckProviderFactory(providerFactory)



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

I am sure the problem is app check because if it's not enforced everything works as expected, and if I enforce it then i get permissions error.我确定问题出在应用程序检查上,因为如果它没有强制执行,一切都会按预期工作,如果我强制执行它,则会出现权限错误。 (this happens only on iOS 16) (这仅发生在 iOS 16 上)

import SwiftUI
import Firebase
import FirebaseCore
import FirebaseAppCheck

class AppDelegate: NSObject, UIApplicationDelegate {
    let providerFactory = ACFTAppCheckProviderFactory()
    
    func application(_ application: UIApplication,
                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
        
        AppCheck.setAppCheckProviderFactory(providerFactory)
        
        FirebaseApp.configure()
        return true
    }
}

@main
struct ACFTApp: App {
    @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
    
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}

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

在此处输入图像描述

Set the App attest env.设置 App 认证环境。 to production.生产。 Ensure you add App Attest capability to your app target.确保将 App Attest 功能添加到您的应用程序目标。 Remove the -FIRDebugEnabled in your app scheme/run/arguments.在您的应用方案/运行/参数中删除 -FIRDebugEnabled。 Possibly ensure you add the debug token to your registered apps/manage tokens on FB.可能确保您将调试令牌添加到您在 FB 上注册的应用程序/管理令牌。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 iOS 16 + Firebase:应用程序引用非公共选择器确定AppInstallationAttributionWithCompletionHandler: - iOS 16 + Firebase: The app references non-public selectors determineAppInstallationAttributionWithCompletionHandler: 从 firebase App Distribution,iOS 16 打开应用程序需要开发者模式 - Developer mode required to open app from firebase App Distribution, iOS 16 Firebase App Check iOS - 在范围内找不到类型“AppCheckProviderFactory” - Firebase App Check iOS - Cannot find type 'AppCheckProviderFactory' in scope iOS 应用程序未收到 Firebase 通知 - iOS app not receiving Firebase notifications Firebase 动态链接在 IOS 上不起作用 - Firebase dynamic link is not working on IOS 将 IOS firebase 应用程序连接到我的 flutter 应用程序 - Connecting IOS firebase app to my flutter app 检查 Firebase 应用程序是否已在 python 中初始化 - check if a Firebase App is already initialized in python 我是否需要 Firebase 项目才能使用 Firebase App Check? - Do I need a Firebase project to use Firebase App Check? Firebase App Check with Vue 3 Invalid app resource name - Firebase App Check with Vue 3 Invalid app resource name Firebase:如何在应用检查中注册我的 Flutter 应用? - Firebase: How do I register my Flutter app in app check?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM