0% found this document useful (0 votes)
41 views

Gmail Authentication in React Native.

This document discusses authentication options in React Native apps, focusing on using Firebase authentication. It outlines the main authentication methods like social logins, creating your own backend, and using backend as a service platforms. It then provides more details on Firebase, describing its features and authentication options, including email and social logins. Finally, it lists the steps to create a basic React Native app with Google authentication using Firebase.

Uploaded by

aimen azeem
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Gmail Authentication in React Native.

This document discusses authentication options in React Native apps, focusing on using Firebase authentication. It outlines the main authentication methods like social logins, creating your own backend, and using backend as a service platforms. It then provides more details on Firebase, describing its features and authentication options, including email and social logins. Finally, it lists the steps to create a basic React Native app with Google authentication using Firebase.

Uploaded by

aimen azeem
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Gmail authentication in react native.

Authentication in React Native


React Native has been around for around 4 years, and has been very popular among
developers for its ease of usage over Swift / Java. Also you get to keep a single source code for
both Android and iOS app. What more can a developer ask for!

React Native 0.60 is the latest version (at the time of writing this post), and is much more
reliable and robust than previous versions. It also includes breaking changes related to
AndroidX, but don’t worry we’ll create an Android test app as well.

There are several ways of Authentication in React Native Apps

Social logins — Social logins are a popular and easy way of authentication in mobile apps. You
must have seen Google, Facebook, Instagram logins in almost all the modern apps. Social
logins are easy to use and more reliable for quick integrations.
Create you own back-end — You can create your own back-end in Node.js, Go, Django or
Ruby-on-rails, and connect your app authentication to your own back-end. This method is
favored by developers who need full control over the user authentication. But this method is the
most time taking one as well.
Back-end as a Service (BaaS) — You can use pre-built BaaS platforms which allows easy
integration of authentication in your apps. Basically, these platforms provide you a ready-made
back-end, so you don’t have to make one on your own. Firebase, Parse, Back4App are some
BaaS platforms.
Firebase is the most popular among these for mobile apps, which we’ll study in next section

Firebase
Firebase is a Backend-as-a-Service (BaaS) platform. It started as a YC11 startup and grew up
into a next-generation app-development platform on Google Cloud Platform. It is getting popular
by the day because of the ease of integration and variety of functionalities available on it.

A lot of quick integrations are available with Firebase. Some of these are listed below:

Real-time database
Email Authentication
Social logins
In-app messages
Push notifications
Analytics
Crashlytics
Remote config
Firebase is quickly growing to become the most popular mobile app back-end platform.

Firebase Authentication Options


Firebase not only provides ready-made email authentication, but also provides authentication
using a variety of social logins. You can see the authentication options available with Firebase.
Use this keystore file location to generate SHA-1 signature. Keep the signature safe for further
steps. SHA-1 looks like this
No I want only one debug.keystore in my life ! 😠
If however, you don’t want to include this keystore and want to generate the signature using
default keystore file, then you need to update the default keystore file’s location in

android → app → build.gradle → signingConfigs

Enter the correct values insigningConfigs for your own key

signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
}
Steps for Google authentication
We will follow these step-by-step instructions to create our React Native app with Google
authentication

Step 1: Create Firebase Project and Add android platform

‌Step 2: Enable Google Sign-In in Firebase project

Step 3: Create a Basic React Native app

‌Step 4: Install the react-native-google-signin package for Google Login

Step 5: Implement Google auth functions in RN app

Step 6: Test your app on Android

Step 7: Use Firebase to store user info and handle Auth

You might also like