Fireship · @fireship
Ionic Google Login for iOS and Android
Uploaded February 23, 2018 · Length 7:20
Summary
Implement Google OAuth login in Ionic for iOS and Android apps, including progressive web apps, using Cordova plug-in and Firebase.
- ionic google login
- firebase oauth
- cordova plugin
- google login ios
- google login android
- progressive web app login
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
[Music]
- 0:01
fire base makes Google OAuth extremely
- 0:04
easy and web apps but if we're building
- 0:06
a native mobile app with ionic there are
- 0:08
some additional considerations we need
- 0:10
to think about for iOS and Android when
- 0:13
logging in we can't just use a regular
- 0:14
browser popup window or URL redirect
- 0:17
like we would in a web app instead we
- 0:19
use a Cordova plug-in to access features
- 0:21
that are only available on the native
- 0:22
mobile device in this video I'm going to
- 0:25
show you how to implement Google OAuth
- 0:26
from scratch in a way that works for iOS
- 0:29
and Android
- 0:29
as well as progressive web apps if
- 0:32
you're new here make sure to subscribe
- 0:33
and you can follow along with the source
- 0:35
code at angular firebase com I am
- 0:38
starting out from a brand new ionic app
- 0:39
and setting a custom ID that we can use
- 0:41
to register our app with iOS and Android
- 0:44
on the firebase console your ID should
- 0:47
follow a format of com dot brand name
- 0:50
dot project name just to give you a
- 0:52
heads up this episode's going to have a
- 0:53
lot of long commands like this but you
- 0:55
can copy and paste all of them from the
- 0:57
main write up the next thing we'll do is
- 0:59
install firebase and angular fire 2 into
- 1:02
our project and lastly we'll need a
- 1:04
component in ionic for our Google login
- 1:07
feature if we jump into our app at this
- 1:09
point we should be able to go into the
- 1:11
config.xml file and you should see your
- 1:13
project ID that you set from the command
- 1:15
line as the widget ID but if starting
- 1:17
from an existing app go ahead and update
- 1:19
the default ID to whatever your project
- 1:21
ID happens to be now we can set up our
- 1:24
mobile apps in firebase so you'll go
- 1:26
ahead and add an app to your project and
- 1:28
we'll start with the iOS configuration
- 1:31
all you have to do is enter your project
- 1:33
ID and then go through the steps you
- 1:36
don't need to do anything else other
- 1:37
than register your app with this ID that
- 1:40
takes care of iOS for Android we have an
- 1:43
additional step for local development
- 1:45
we'll start by entering the same project
- 1:47
ID like we just did but we also need the
- 1:50
debug signing certificate to enable
- 1:52
Google+ from our local development
- 1:54
environment you can obtain the
- 1:56
certificate from the command-line and
- 1:57
you'll need one for every machine that
- 1:59
you use in the development of this app


