-
Notifications
You must be signed in to change notification settings - Fork 7
Implement Sign In with Google
Thanks for choosing EasyFirebase! π Follow these steps to implement Google Sign-In into your iOS or macOS project.
Go to your Google Cloud Console, and navigate to APIs & Services. Click the Credentials tab, then click Create Credential. In the drop-down, choose OAuth Client ID.
In the Application Type drop-down, choose iOS. Next, fill in the fields. For Name, choose any name relating to Google Sign-In. For Bundle ID, use your Xcode project bundle ID. You can leave the remaining fields blank, and click Create.
You'll then get an important pop-up.
In the Application Type drop-down, choose Desktop. Next, fill in the Name field with any name relating to Google Sign-In. Then click Create.
You'll then get an important pop-up.
Go to your Firebase Console. Select the Authentication tab, then Sign-in Method. Click Add new provider, then choose Google.
Toggle the Enable switch, then fill out the appropriate fields. Finally, click Save.
Copy your Client ID that you saved from earlier. Remove .apps.googleusercontent.com
from the end:
Before: xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
After: xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In your view, create a Google Sign-In button, that, when pressed, executes the following:
EasyAuth.signInWithGoogle(clientID: "xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") { error in
// If error is not-nil, an issue occurred.
}
Copy your Client ID and Secret that you saved from earlier. Remove .apps.googleusercontent.com
from the end of the Client ID:
Client ID Before: xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
Client ID After: xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Client Secret: GOCSPX-xxxxxxxxxxxxxxxxxxxxxxxxxxxx
In your view, create a Google Sign-In button, that, when pressed, executes the following:
EasyAuth.signInWithGoogle(clientID: "xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
secret: "GOCSPX-xxxxxxxxxxxxxxxxxxxxxxxxxxxx") { error in
// If error is not-nil, an issue occurred.
}
EasyFirebase Wiki
β Installation
π Get Started with EasyAuth
π₯ Get Started with EasyFirestore
π Implement Sign In with Google
π Implement Sign In with Apple
π Using the Example Project
π Flowductive Website