Giter VIP home page Giter VIP logo

react-native-firebase-documentation-example's Introduction

React Native Firebase Documentation (example)

Official Github Repo

Getting Started

New users

If you haven't set up a Firebase project inside the console, you should do that first. Read here how to accomplish this.

The following steps will create a React Native app with React Native Firebase already pre-packaged:

npx @react-native-community/cli init --template=@react-native-firebase/template <name>

Where <name> is the name your project.

If at any point the process fails with could not find spec, follow the instructions below:

cd <name>/ios
pod install

Now you are complete. Move onto Adding Firebase Credentials to your app.

Existing React Native apps

Follow the commands below:

npm install --save @react-native-firebase/app
# or if using Yarn
yarn add @react-native-firebase/app
cd ios
pod install

Migrating from V5

With React Native 0.60+ autolinking is supported, so a lot of references need to be removed to avoid issues with RN 0.60+. Here's how to migrate

lengthy removal steps here, but ideally a bunch of command line/git diff statements with as little words as possible breaking it up - but if there are words, they should explain some anomaly.

Adding Firebase Credentials

iOS

Download GoogleService-Info.plist, and add into your XCode project, ensuring the "Copy items if needed" checkbox is selected.

Then open up AppDelegate.m, and at the top add this line:

#import <Firebase.h>

And further down where you can find didFinishLaunchingWithOptions, copy and paste the following:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
if ([FIRApp defaultApp] == nil) {
  [FIRApp configure];
}

In a terminal, run the following at the root of your project:

cd ios/
pod install --repo-update
cd ...
npx react-native run-ios

Android

Go to android/build.gradle and add the following:

buildscript {
    dependencies {
        // ...
        classpath 'com.google.gms:google-services:4.2.0'
    }
}

Go to android/app/build.gradle and at the very bottom of the file, add the following:

apply plugin: 'com.google.gms.google-services'

Open a terminal at the root of the project and run

npx react-native run-android

react-native-firebase-documentation-example's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.