Redeem Now
Read More
Read now

Integrating GoogleSigin in iOS (Swift)

Save

In iOS we can login into the app through Social account, then we don’t need to fill a long form to register into the app, let’s see below integrating GoogleSigin in iOS (Swift).

GoogleSignIn SDK installation

First, we need to install Google Signin pod.

Here’s how your Podfile should look like:

Creating OAuth client ID for GoogleSignIn

After the SDK installation, you will need an OAuth client ID and an iOS URL scheme so that you can continue with the configuration in Xcode.

Now open Google APIs Console and create a project for your sample app. If you have already created a project, you can also select it from the project list.

After creating a project, we also need to configure the OAuth consent screen. Follow the steps as shown in the image below to choose your app user type and then create the OAuth consent screen.

In the OAuth consent screen information page, fill in the application name, and then click “save”. This application name will be the name being shown in the Google Sign-in form when a user tries to sign in using your app.

After finishing configuring the OAuth consent screen, it’s time to create the OAuth client ID. Please check the below image to navigate to the OAuth client ID creation page.

 

Once you reach the OAuth client ID creation page, go ahead and select “iOS” as application type, fill in the name and also your sample app bundle ID and then click “create”.

 

Copy the OAuth client ID and iOS URL scheme you just created and save them, you will need both of them in just a bit.

GoogleSignIn SDK configuration in Xcode

Step1: Open project in xcode, select target and in Info section add iOS URL scheme in URL Types

Step2: Now, open AppDelegate class and import GoogleSignIn module.

Step3: After that, add below code into application(_:didFinishLaunchingWithOptions:) method.

Step4: Then just after application(_:didFinishLaunchingWithOptions:), add below method

Finally, the GoogleSignIn is implemented in our project, now we can run it and check GoogleSignIn.

As, we can see integrating GoogleSigin in iOS (Swift) is so easy, for more detailed information please check here.

Also check Google Signin implementation in objective-c here.

. . .

Comment

Add Your Comment

Be the first to comment.

css.php
Hire Us!
Brief us about your requirements and we'll get back to you.
Woo! Hooy!
We have just recieved your project brief and our expert will contact you shortly.
Send Again
Close