From 76e4adc1cc1b66d7f9fd8e897e413bec1c58a645 Mon Sep 17 00:00:00 2001 From: Wawa Date: Mon, 21 Apr 2025 00:17:10 +0200 Subject: [PATCH] docs(app-check): update doc accordingly to new AppDelegate.swift in rn 0.79 --- docs/app-check/usage/index.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/app-check/usage/index.md b/docs/app-check/usage/index.md index 3929500f58..81446c20fd 100644 --- a/docs/app-check/usage/index.md +++ b/docs/app-check/usage/index.md @@ -89,7 +89,32 @@ For instructions on how to generate required keys and register an app for the de You must call initialize the AppCheck module prior to calling any firebase back-end services for App Check to function. -#### Configure AppCheck with iOS credentials (react-native 0.77+) +#### Configure AppCheck with iOS credentials (react-native 0.79+) + +To do that, edit your `ios/ProjectName/AppDelegate.swift` and add the following two lines: + +At the top of the file, import the FirebaseCore SDK right after `import UIKit`: +And within your existing `didFinishLaunchingWithOptions` method, add the following to the top of the method: + +```diff +import UIKit ++ import RNFBAppCheck // <-- This is the import for AppCheck to work ++ import FirebaseCore // <-- From App/Core integration, no other Firebase items needed +import React +import React_RCTAppDelegate +import ReactAppDependencyProvider + +... + + func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil + ) -> Bool { ++ RNFBAppCheckModule.sharedInstance() // <-- new for AppCheck to work ++ FirebaseApp.configure() // <-- From App/Core integration +``` + +#### Configure AppCheck with iOS credentials (react-native >= 0.77 && < 0.79) To do that, edit your `ios/ProjectName/AppDelegate.swift` and add the following two lines: