iosswiftfirebase-app-check

App Check debug provider on Apple platforms


I use xcode very rarely and maybe this is a stupid question, but where do I put the code when the firebase instructions say "In your debug build"

The code:

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

I want to generate a firebase app-check debug token

link firebase instruction: https://firebase.google.com/docs/app-check/ios/debug-provider

instructions: In your debug build, before using any Firebase backend services, create and set the App Check debug provider factory


Solution

  • I think you can put them inside the AppDelegate in this method below:

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) {
            let providerFactory = AppCheckDebugProviderFactory()
            AppCheck.setAppCheckProviderFactory(providerFactory)
                        
            FirebaseApp.configure()
    }