- Sign up for firebase console and create a new project using '+' button in firebase console.
- Enter project name and click on create project button.
- Allow google analytics if you want.
- After creating a successful project, open project's dashboard and click on android icon and follow the steps.
- Add applicationId of your project ( present in build.gradle file of android folder ), add a nickname and SHA - debug key (Optional).
- Download google-services.json file and place it inside app folder of android.
- open your vue-native project using terminal and npm install
react-native-firebase
. - Then run command
react-native link react-native-firebase
. - Add the following dependencies to
android/app/build.gradle file
implementation "com.google.android.gms:play-services-base:16.1.0"
implementation "com.google.firebase:firebase-core:16.0.9"
implementation "com.google.firebase:firebase-auth:17.0.0"
implementation "com.google.firebase:firebase-firestore:19.0.0"
Also add,apply plugin: 'com.google.gms.google-services'
on the top of this file. - Add the following line to android/build.gradle file.
classpath 'com.google.gms:google-services:4.2.0'
- Change
classpath 'com.android.tools.build:gradle:3.4.0'
to ``classpath 'com.android.tools.build:gradle:3.4.1'` in android/build.gradle file. - Add method
google()
in allprojects/repositories in build.gradle file. - Open MainApplication.java file and add lines
new RNFirebaseAuthPackage(),
new RNFirebaseFirestorePackage()
inside getPackages() function. - Add subsequent imports to above packages in MainApplication.java file
import io.invertase.firebase.auth.RNFirebaseAuthPackage;
import io.invertase.firebase.firestore.RNFirebaseFirestorePackage;
- run command
react-native run-android
to run the project.
- Open your project in firebase console and click on
add app +
button. A new screen will open. - First add the BundleId (can be found in
Xcode>project.xcworkspace>general>bundle identifier
) of your project, project nickname and apple id (Optional). - Then download Google-Service-Info.plist file in the next step and add it using Xcode. Open Xcode> Click on your project name after opening project.xcworkspace file> click on folder with same name as project and select
add files to project_name
>Add Google-Service-Info.plist file. - Now open terminal > ios folder > podfile. If pod file is not created, create a new one using command
pod init
. - Add
pod Firebase/Core
andpod Firebase/Analytics
to podfile. - Add lines
@import Firebase
and[FIRApp configure]
to AppDelegate.m file of your project.(Remove one use_frameworks from pod if found more than one ) - Run pod install.
- Open .xcworkspace file of your project and click on play button.