Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable perform google plus sign in ios using ionic 2

Hi i am applying social login scenario in my ionic app where i applied google sign option and it is working perfectly with android and when comming to the ios im getting the below error

the api key and bundle id everything are set and working perfect

ios google plus error

like image 305
Madpop Avatar asked Oct 28 '22 23:10

Madpop


1 Answers

You have to follow the below steps as configuration for google login through IOS

  1. Go to https://developers.google.com/mobile/add?platform=ios&cntapi=signin for IOS registration
  2. Enter IOS bundle Id from widget Id in config.xml of the project
  3. Enable Google sign In and generate configuration file
  4. Copy the reverse client Id from downloaded file
  5. Install the plugin with reverse client Id instead of webclient Id which we used for Android
  6. run cordova plugin add cordova-plugin-googleplus --save --variable REVERSED_CLIENT_ID="myreversedclientid" We can find the reverse client Id in Google developer console also credentials->iOS URL schema is the reverse client Id

Extract from Plugin documentation

To get your iOS REVERSED_CLIENT_ID, generate a configuration file here. This GoogleService-Info.plist file contains the REVERSED_CLIENT_ID you'll need during installation. This value is only needed for iOS.

The REVERSED_CLIENT_ID is also known as the "iOS URL Scheme" on the Developer's Console.

Login on iOS takes the user to a SafariViewController through the Google SDK, instead of the separate Safari browser.

IMPORTANT:

  1. Please note that myreversedclientid is a place holder for the reversed clientId you find in your iOS configuration file. Do not surround this value with quotes. (iOS only Applications)

  2. If you are building a hybrid application (iOS and Android), or an Android application, you have to replace myreversedclientid with the reverse value of Client ID in your Release credential generated on step 3, on Google Developer's Console, this will be: "com.googleusercontent.apps.uniqueId", without quotes.

like image 163
Prithivi Raj Avatar answered Nov 15 '22 07:11

Prithivi Raj