Skip to content

Commit 071eb9f

Browse files
gregfentonamandeepmittalmikehardy
authored
docs(expo): Expo / EAS updates and fixes (#7502)
Fixed a few formatting issues & divided the section into subsections for clarity in following the steps. --------- Co-authored-by: Aman Mittal <[email protected]> Co-authored-by: Mike Hardy <[email protected]>
1 parent 08797eb commit 071eb9f

File tree

2 files changed

+27
-28
lines changed

2 files changed

+27
-28
lines changed

.spellcheck.dict.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ performant
133133
personalization
134134
plist
135135
Podfile
136+
pre-compiled
136137
pre-configured
137138
pre-fetched
138139
pre-release

docs/index.md

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -181,64 +181,62 @@ you can follow the manual installation steps for [iOS](/install-ios) and [Androi
181181

182182
## Expo
183183

184-
Integration with Expo is possible in both Bare Workflow, and [custom Managed Workflow](https://docs.expo.io/workflow/customizing/) via [config plugins](https://docs.expo.io/guides/config-plugins/).
184+
Integration with Expo is possible when using a [development build](https://docs.expo.dev/workflow/overview/#development-builds). You can configuring the project via [config plugins](https://docs.expo.io/guides/config-plugins/) or manually configure the native projects yourself (the "bare workflow").
185185

186-
React Native Firebase cannot be used in the "Expo Go" app, because [it requires custom native code](https://docs.expo.io/workflow/customizing/).
186+
_NOTE:_ React Native Firebase cannot be used in the pre-compiled [Expo Go app](https://docs.expo.dev/get-started/expo-go/) because React Native Firebase uses native code that is not compiled into Expo Go.
187187

188-
### Expo Bare Workflow
188+
#### Your Expo project
189189

190-
Where possible, it is recommended by the Expo team to use Managed Workflow.
190+
To create a new Expo project, see the [Get started](https://docs.expo.dev/get-started/create-a-project/) guide in Expo documentation.
191191

192-
If you're using [Bare Workflow](https://docs.expo.io/introduction/managed-vs-bare/#bare-workflow), please follow the above [Android Setup](/#2-android-setup) and [iOS Setup](/#3-ios-setup) steps.
192+
#### Install React Native Firebase modules
193193

194-
### Expo Managed Workflow
194+
To install React Native Firebase's base `app` module, use the command `npx expo install @react-native-firebase/app`.
195195

196-
Since Expo Go will not work with react-native-firebase, the suggested workflow is to use a [custom development client]([https://docs.expo.dev/clients/getting-started/](https://docs.expo.dev/develop/development-builds/create-a-build/).
196+
Similarly you can install other React Native Firebase modules such as for Authentication and Crashlytics: `npx expo install @react-native-firebase/auth @react-native-firebase/crashlytics`.
197197

198-
Follow [these directions](https://docs.expo.dev/get-started/create-a-project/) to create a new Expo project.
198+
#### Configure React Native Firebase modules
199199

200-
To install React Native Firebase, use the command `npx expo install @react-native-firebase/app`. After installing, add the [config plugin](https://docs.expo.dev/config-plugins/introduction/) to the [`plugins`](https://docs.expo.io/versions/latest/config/app/#plugins) array of your `app.json` or `app.config.js`.
200+
If you are manually adjusting your Android and iOS projects, follow the same instructions as [React Native CLI projects](#installation-for-react-native-cli-projects).
201201

202-
Also, you must provide paths to the `google-services.json` and `GoogleService-Info.plist` files by specifying the [`expo.android.googleServicesFile`](https://docs.expo.io/versions/latest/config/app/#googleservicesfile-1) and [`expo.ios.googleServicesFile`](https://docs.expo.io/versions/latest/config/app/#googleservicesfile) fields respectively.
202+
The recommended approach is to use [Expo Config Plugins](https://docs.expo.dev/config-plugins/introduction/) to configure React Native Firebase. You will add to the [`plugins`](https://docs.expo.io/versions/latest/config/app/#plugins) array of your `app.json` or `app.config.js`. See the note below to determine which React Native Firebase modules require Config Plugin configurations.
203203

204-
The `app.json` for integration that included the optional crashlytics and performance as well as the mandatory app plugin would look like this, customize based on which optional modules you use:
204+
To enable Firebase on the native Android and iOS platforms, create and download Service Account files for each platform. Then, provide paths to the `google-services.json` and `GoogleService-Info.plist` files by specifying the [`expo.android.googleServicesFile`](https://docs.expo.io/versions/latest/config/app/#googleservicesfile-1) and [`expo.ios.googleServicesFile`](https://docs.expo.io/versions/latest/config/app/#googleservicesfile) fields. See the example configuration below.
205+
206+
For iOS only, since `firebase-ios-sdk` requires `use_frameworks` configure [`expo-build-properties`](https://docs.expo.dev/versions/latest/sdk/build-properties/#pluginconfigtypeios) and add the following entry to the `plugins` array in `app.json`:
207+
208+
Here is an example `app.json` to enable the Firebase App, Auth and Crashlytics modules, the Service Account files for both mobile platforms and setting the application ID to the example value of `com.mycorp.myapp` (change to match your own):
205209

206210
```json
207211
{
208212
"expo": {
209213
"android": {
210-
"googleServicesFile": "./google-services.json"
214+
"googleServicesFile": "./google-services.json",
215+
"package": "com.mycorp.myapp"
211216
},
212217
"ios": {
213-
"googleServicesFile": "./GoogleService-Info.plist"
218+
"googleServicesFile": "./GoogleService-Info.plist",
219+
"bundleIdentifier": "com.mycorp.myapp",
220+
"useFrameworks": "static"
214221
},
215222
"plugins": [
216223
"@react-native-firebase/app",
217-
"@react-native-firebase/perf",
224+
"@react-native-firebase/auth",
218225
"@react-native-firebase/crashlytics"
219226
]
220227
}
221228
}
222229
```
223230

224-
> Listing config plugins (the `"plugins"` array in the JSON above) is only required for React Native Firebase modules that involve native installation steps - e.g. modifying the Xcode project, `Podfile`, `build.gradle`, `AndroidManifest.xml` etc. React Native Firebase packages without native steps will work out of the box. Not all packages have Expo config plugins provided yet. A React Native Firebase module has config plugin support if it contains an `app.plugin.js` file in its package directory.
231+
> Listing a module in the Config Plugins (the `"plugins"` array in the JSON above) is only required for React Native Firebase modules that involve _native installation steps_ - e.g. modifying the Xcode project, `Podfile`, `build.gradle`, `AndroidManifest.xml` etc. React Native Firebase modules without native steps will work out of the box; no `"plugins" entry is required. Not all modules have Expo Config Plugins provided yet. A React Native Firebase module has Config Plugin support if it contains an `app.plugin.js` file in its package directory (e.g.`node_modules/@react-native-firebase/app/app.plugin.js`).
225232
226-
For iOS only, since `firebase-ios-sdk` requires `use_frameworks` please configure [expo-build-properties](https://docs.expo.dev/versions/latest/sdk/build-properties/#pluginconfigtypeios) and add the following entry to their `plugins` array in `app.json`:
233+
#### Local app compilation
227234

228-
```json
229-
[
230-
"expo-build-properties",
231-
{
232-
"ios": {
233-
"useFrameworks": "static"
234-
}
235-
}
236-
]
237-
```
235+
If you are compiling your app locally, use the local app compilation steps described in [Local app development](https://docs.expo.dev/guides/local-app-development/) guide in Expo docs.
238236

239-
Next, if you are **not** using EAS Build then you must use the `expo prebuild --clean` command as described in the ["Adding custom native code"](https://docs.expo.io/workflow/customizing/) guide to rebuild your app locally to include the config plugin changes. If this command isn't run, you'll encounter connection errors to Firebase.
237+
#### Expo Tools for VSCode
240238

241-
> If you are using the [Expo Tools](https://marketplace.visualstudio.com/items?itemName=expo.vscode-expo-tools) VSCode extension, the IntelliSense will display a list of available plugins, when editing the `plugins` section of `app.json`.
239+
If you are using the [Expo Tools](https://marketplace.visualstudio.com/items?itemName=expo.vscode-expo-tools) VSCode extension, the IntelliSense will display a list of available plugins when editing the `plugins` section of `app.json`.
242240

243241
---
244242

0 commit comments

Comments
 (0)