Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[📚] Add react-native-firebase in an expo managed project. #6990

Closed
Saad-Bashar opened this issue Mar 19, 2023 · 5 comments
Closed

[📚] Add react-native-firebase in an expo managed project. #6990

Saad-Bashar opened this issue Mar 19, 2023 · 5 comments
Labels
help: good-first-issue Issues that are non-critical issues & well defined for first time contributors.

Comments

@Saad-Bashar
Copy link

Documentation Feedback

Right now there is a section on adding this package to an expo-managed project. That is already good. But I have faced few troubles following the docs. So I have added a few more details. Hope this is useful,

Summary of installing react-native-firebase package successfully in an expo project.

1. Install expo-dev-client

Since React Native Firebase requires custom native code, you need to install the expo-dev-client library in your project. It also allows configuring any native code required by React Native Firebase using Config plugins without writing native code yourself.

To install [expo-dev-client](https://docs.expo.dev/development/getting-started#installing--expo-dev-client--in-your-project), run the following command in your project:

npx expo install expo-dev-client

2. Install React Native Firebase

To use React Native Firebase, it is necessary to install the @react-native-firebase/app module. This module provides the core functionality for all other modules. It also adds custom native code to your project using a config plugin. You can install it using the following command:

npx expo install @react-native-firebase/app

3. Add plugin

Go to app.json and add the following at the end,

"plugins": [
      "@react-native-firebase/app",
      [
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static"
          }
        }
      ]
    ]
💡 You do not need to add `“@react-native-firebase/firestore"`, `"@react-native-firebase/authentication"`,

4. Install expo build properties

Install expo-build-properties by running,

npx expo install expo-build-properties

5. Expo prebuild

Then run expo prebuild,

expo prebuild --clean

6. Run the app,

npx expo run:android or npx expo run:ios

Try first using an android device.

but if you need to run on an emulator or simulator, then

  • You need both Android Studio and Xcode installed and configured on your computer.
  • Then, you can run the project using npx expo run:android or npx expo run:ios command.

@Saad-Bashar Saad-Bashar added help: good-first-issue Issues that are non-critical issues & well defined for first time contributors. Type: Docs labels Mar 19, 2023
@Saad-Bashar Saad-Bashar changed the title [📚] Documentation Issue Title - Add react-native-firebase in an expo managed project. [📚] Add react-native-firebase in an expo managed project. Mar 19, 2023
@mikehardy
Copy link
Collaborator

Hi there - this would work best as a PR to the docs - you can propose a PR to docs by just clicking the edit button on the top right of every documentation change

I do not personally use Expo so I cannot verify those and do not propose PRs to Expo docs, but our Expo users (like yourself!) are more than welcome to and I merge those regularly

Thanks!

@Atomic71
Copy link

@mikehardy if you reopen this, maybe I can tackle it (unless @Saad-Bashar you plan on doing this)

@mikehardy
Copy link
Collaborator

No need to reopen the issue, we can still communicate, and you may open a PR any time

@guidani
Copy link

guidani commented Jun 14, 2023

But, where the google-service.json file go using a Managed Flow?

@IvanFestina
Copy link

But, where the google-service.json file go using a Managed Flow?

You have to provide paths to the google-services.json
check out this link
https://rnfirebase.io/#managed-workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help: good-first-issue Issues that are non-critical issues & well defined for first time contributors.
Projects
None yet
Development

No branches or pull requests

5 participants