Skip to content

Commit 9c1a9a8

Browse files
bigriotmikehardy
andauthored
docs: Add instructions for iOS AppDelegate.swift on react-native 0.77 (#8265)
* Added instructions for iOS AppDelegate.swift on react-native 0.77 * style(lint): `yarn lint:markdown --write` --------- Co-authored-by: Mike Hardy <github@mikehardy.net>
1 parent 12ddc18 commit 9c1a9a8

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

docs/index.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,30 @@ Select the downloaded `GoogleService-Info.plist` file from your computer, and en
174174

175175
![Select 'Copy Items if needed'](https://prismic-io.s3.amazonaws.com/invertase%2F7d37e0ce-3e79-468d-930c-b7dc7bc2e291_unknown+%282%29.png)
176176

177-
#### Configure Firebase with iOS credentials
177+
#### Configure Firebase with iOS credentials (react-native 0.77+)
178+
179+
To allow Firebase on iOS to use the credentials, the Firebase iOS SDK must be configured during the bootstrap phase of your application.
180+
181+
To do this, open your `/ios/{projectName}/AppDelegate.swift` file and add the following:
182+
183+
At the top of the file, import the Firebase SDK right after `'import ReactAppDependencyProvider'`:
184+
185+
```
186+
import Firebase
187+
```
188+
189+
Within your existing `didFinishLaunchingWithOptions` method, add the following to the top of the method:
190+
191+
```
192+
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
193+
// Add me --- \/
194+
FirebaseApp.configure()
195+
// Add me --- /\
196+
// ...
197+
}
198+
```
199+
200+
#### Configure Firebase with iOS credentials (react-native < 0.77)
178201

179202
To allow Firebase on iOS to use the credentials, the Firebase iOS SDK must be configured during the bootstrap phase of your application.
180203

0 commit comments

Comments
 (0)