Hey, so stop me if you've heard this before.
Don't actually stop the video.
That's just an expression.
But using a trusted third party like Google
to handle sign-in for your app can be
a great benefit for everybody.
Your users don't have to come up with yet another username
and password, and you as a developer
don't need to hire a full-time security
team to keep that all safe.
That said, developers had a few concerns
with Google's original sign-in library for iOS.
Your users needed a Google+ account,
which not everybody had.
It was also kind of big.
And if your users didn't have the Google+ app installed,
it would swap them out to Safari in order to complete
the sign-in process, which was a kind of clunky user experience.
This also led to some issues during the app review process,
which is never a good thing.
But I'm happy to report that we've
addressed all these concerns with the new Google Sign-in
library for iOS.
Let's find out more on this episode of Route 85.
[MUSIC PLAYING]
So let's imagine you've got an app
and you want your users to sign in, maybe
so they can use their account on different devices,
maybe so they can access their data on your server.
You know, there's a number of different reasons.
And while you could certainly deal with this yourself
by having your users create their own usernames
and passwords and storing them in a database somewhere,
this can be a hassle, particularly
if you don't have a dedicated security team working 24/7
to keep that database safe.
Do you?
And no, your cats don't count.
Oh, but that is good advice, though.
So for many developers, a better option
is to let a trusted third party like Google take care
of the sign-in work for you.
Your users can sign into Google using an account that they
already have, and we give you some profile information
that you can then use to identify
that user for your app.
And so that's what you're looking at here.
I'm clicking the Sign-in with Google
button so that I can sign into my account.
I copy and paste my password so that you people can't see it.
I'm on to you.
I click the Accept button, and there we go, I'm signed in.
So does this look somewhat familiar?
I bet you it probably does.
We've had Sign-in available for many years now as part
of the Google+ library on iOS.
But I'm using the new and improved Google Sign-in
library, which comes with a number of improvements
that you may not be aware of.
For starters, I can now sign in with any Google account,
whether or not I've signed up for Google+ with that account.
Now, granted if you wanted to see my Google+ relationship
status, or see who's in my circles, or what have you,
you could still do that.
You'd add some Google+ scopes to your sign-in request,
and then I would need a Google+ account.
But if all you're looking to do is just sign-in a user so
that you can remember who they are,
maybe get like their name and profile
picture, just a plain old Google account is all I would need.
For another thing, it's a lot more lightweight.
This new Sign-in library is about a third
of the size of the old one, which
means there's less stuff for users to download,
and, you know, that's always a good thing.
And finally, the user experience has been greatly improved.
With the older version of Sign-in, signing in
involved one of two options.
You could switch over to the native Google+ app,
or you could switch to Safari.
Now, using the native Google+ app wasn't so bad.
In fact, it was pretty slick.
It was nice.
But not everybody had that installed,
which meant that they were stuck with swapping out to Safari,
and this tended to be a less slick experience and one
that sometimes lead to rejections during the app
approval process.
And that didn't just make users sad,
it made developers sad, too.
So with the new version of Google Sign-in,
we'll first try and switch you over to any native Google app
you might be signed in to, whether that's
Google Search, or YouTube, Maps, or what have you.
But if your user doesn't have any of those installed,
well, that's not a problem.
We now slide up the sign-in page in a UIWebView
right within the application.
There's no more switching out to Safari.
Hurray!
Oh, and both these experiences get a whole lot better
in iOS 9.
For starters, we're able to use a Safari view controller
for the embedded WebView, which is not only
more secure than using the old WebView,
but it also means that if your user has already
logged into Google in Safari, they
don't need to do it again when they sign in to your app.
So that whole enter your username and password thing
you saw earlier, we get to skip that.
And switching to a native app is now super, super slick.
Since iOS 9 is in beta, according to Apple's NDA,
I'm technically not allowed to show you
what it looks like, so this picture of a unicorn barfing
a rainbow will have to give you a general idea of how great
it is.
But seriously, the whole experience,
it looks really nice in iOS 9.
The team did a really good job.
I think you're going to be happy here.
So to get started using Google Sign-in,
you can check out our documentation here.
Please note that the old Sign-in experience is still available
as part of the Google+ library and still sometimes shows up
in search results.
So you want to make sure you're looking
at the documentation with the green header
here, not this documentation with the red one.
But hey, you've made it to the end of this video,
so you must like videos, or maybe you just like me.
How you doing?
Either way, how about I treat you
to a little video of my walking through the process of adding
Google Sign-in to an app.
Com on, follow along.
It'll be fun.
As for the rest of you, if you don't like screencast,
that's OK.
I'll still see you soon on Route 85.
[MUSIC PLAYING]