Getting started with Google Sign-In on Apple platforms

preview_player
Показать описание
In this video, Firebase Senior Developer Advocate @PeterFriese will walk you through how to get started with Google Sign-In on iOS.

Learn how to add the Google Sign-In SDK to your app, where to find the reversed client ID for your app, how to implement a sign-in button in SwiftUI, how to handle the OAuth flow using async/await, and how to make sure users stay signed in to your app even after closing the app.

Chapters:
0:00 What we're going to cover in this video
0:35 The sample app
1:30 The unique user ID
2:17 Adding the Google Sign-In SDK
3:24 Adding the reversed client ID to the URL schemes
4:01 Enabling Google Sign-In in the Firebase console
5:08 App Store Review Guidelines
5:49 Adding the Firebase Emulator
7:09 Implementing the Google Sign-In button
8:54 How does signing in with OAuth providers work?
9:45 Configuring the Google Sign-In SDK
12:02 Implementing the signInWithGoogle method
15:21 Demo: signing in with an account that has 2FA enabled
16:33 Monitoring authentication state
16:54 Signing out
17:32 Where to go from here?

Resources:

#FirebaseFundamentals
Рекомендации по теме
Комментарии
Автор

Hope you never stop this series! I'm very grateful! you are saving me a lot of time.

ManochonARG
Автор

This is awesome! Thank you so much Peter!

qxmxvzi
Автор

Can you demonstrate how to log into MacOS using Google credentials?

alanwalker
Автор

The code you provided in the video cannot work. The 'Google' button you implemented in the UI has action 'signInWithGoogle' however you made that async later in the video and the code won't compile. Wrapping the action inside a Task is also a bad idea since you have UI code (accessing the root view controller) on a background thread. One way to fix this is to wrap the AuthViewModel in a @MainActor. This solves the issue but keep in mind this will block the UI once the code is waiting for the result from Firebase (since it's await).

MrGamer