Skip to content

Commit a28753b

Browse files
wneelmikehardy
authored andcommitted
docs: Add instructions for AppCheck on iOS AppDelegate.swift on react-native 0.77+
1 parent b462330 commit a28753b

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.spellcheck.dict.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ firebase-admin
7474
firebase-ios-sdk
7575
firebase-js-sdk
7676
FirebaseApp
77+
FirebaseCore
7778
firestore
7879
Firestore
7980
GDPR

docs/app-check/usage/index.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,30 @@ For instructions on how to generate required keys and register an app for the de
8989
9090
You must call initialize the AppCheck module prior to calling any firebase back-end services for App Check to function.
9191

92+
#### Configure AppCheck with iOS credentials (react-native 0.77+)
93+
94+
To do that, edit your `ios/ProjectName/AppDelegate.swift` and add the following two lines:
95+
96+
At the top of the file, import the FirebaseCore SDK right after `import UIKit`:
97+
And within your existing `didFinishLaunchingWithOptions` method, add the following to the top of the method:
98+
99+
```diff
100+
import UIKit
101+
+ import RNFBAppCheck // <-- This is the import for AppCheck to work
102+
+ import FirebaseCore // <-- From App/Core integration, no other Firebase items needed
103+
import React
104+
import React_RCTAppDelegate
105+
import ReactAppDependencyProvider
106+
107+
@main
108+
class AppDelegate: RCTAppDelegate {
109+
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
110+
+ RNFBAppCheckModule.sharedInstance() // <-- new for AppCheck to work
111+
+ FirebaseApp.configure() // <-- From App/Core integration
112+
```
113+
114+
#### Configure Firebase with iOS credentials (react-native < 0.77)
115+
92116
To do that, edit your `ios/ProjectName/AppDelegate.mm` and add the following two lines:
93117

94118
```objectivec

0 commit comments

Comments
 (0)