React Native Firebase Setup for both Android and iOS(Step by Step)

Photo by Clayton Robbins on Unsplash

1. Create a react native project

2. Create a Firebase project on firebase

3. Installing React Native Firebase App library

npm install --save @react-native-firebase/app

Firebase Android Setup

/android/app/google-services.json

Configure Firebase with Android credentials

buildscript {
dependencies {
// ... other dependencies
classpath 'com.google.gms:google-services:4.3.3'
// Add me --- /\
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services' //
add this line

iOS Setup

1. Create app and download GoogleService-Info.plist file

confirming your bundler ID
download GoogleService Info file from firebase
add google plist file via Xcode

Configure Firebase with iOS credentials

#import <Firebase.h>
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Add me --- \/
if ([FIRApp defaultApp] == nil) {
[FIRApp configure];
}

// Add me --- /\
// ...
}

Wrap up

A Frontend and Mobile Developer. I share my learning experience through writing based on what I will want to read when learning a new concept to help others.