Google Login

Estimated reading: 2 minutes 284 views
  • Start Integrating Google Sign-In into Your IOS App 
  • After this click on Create Project link to create a new project.
  • Enter Project Name and click on Create button.
  • Select the project from the dropdown menu beside IOS.
  • Add Package name from your Project Solution -> Bundle Identifire .
  • Click on APIs & Services then click on +ENABLE APIS AND SERVICES.
  • Search for Google+ and enable Google+ API.
  • Once enabled, click on Credentials, on the top nav-bar, click on +Create credentials then click on the API key
  • Select Application restrictions  IOS apps with Package name from your Project Solution -> Bundle Identifire .
  • Select API restrictions specify the enabled APIs that this key can call
  • Grab the key and Click Save.
  • Once enabled, click on Credentials, on the top nav-bar, click on +Create credentials then click on Oauth client ID
  • In OAuth consent screen page, choose External, fill the form and click Save and Continue.
    • In Authorized domains section, make sure to add your own domain name with or without www.
  • On the next page, you’ll see the button Add or remove scopes, click on it.
    • Look for auth/userinfo.email and select it.
    • Look for auth/userinfo.profile and select it.
    • Scroll down and click on UPDATE.
  • If you successfully added the new scopes, click on SAVE AND CONTINUE.
  • Ignore the Test users section and click on SAVE AND CONTINUE.
  • Scroll down and click on BACK TO DASHBOARD.
  • On the next page, click on PUBLISH APP and publish your application.
  • On the left nav bar, click on Credentials, on the top nav-bar, click on +Create credentials then Oauth client ID
    • In Application type, choose web application.
    • In Authorized redirect URIs, add the following URIs:
      1. https://yourwebsite.com/login-with.php?provider=Google
      2. https://www.yourwebsite.com/login-with.php?provider=Google
  • Put that key in Info.plist file

To show and hide Google login button, You can go to struct ControlSettings. In that struct you can change the setting accordingly

Leave a Comment