Google SignIn gets exception

I am working on Google SignIn

. I got an exception after clicking the SignIn button. I GoogleService-Info.plist

also accept

Exception: Application terminated due to uncaught "NSInvalidArgumentException", reason: "Your application does not support the following URL schemes: com.googleusercontent.apps.337335047637-ciu1dmqo156sdv1idjmm9olljduofdam

+3


source to share


2 answers


Signing in to Google requires a custom URL scheme to be added to the project. To add a custom schema:

  • Open the project configuration: double-click the project name in the left tree view. Select your app from the TARGETS section, then select the Info tab and expand the URL Types section.
  • Click the + button and add a URL scheme for your reverse customer ID. To find this value, open the GoogleService-Info.plist configuration file and find the REVERSED_CLIENT_ID key. Copy the value of this key and paste it into the URL Schemes field on the configuration page. Leave the rest of the fields blank.

See here for details.



Add url scheme for your project

Login to Google

+3


source


This error occurs because the URLScheme is not set correctly for Google login.

From iOS9, all urls of all urls should be tagged before use. Otherwise, canOpenURl

errors are thrown.

To solve the above problem, you need to add URLScheme whitelist to GoogleInfo.plist



Paste below code into .plist

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>com.example.foo</string>
    <string>com.googleusercontent.apps.337335047637-ciu1dmqo156sdv1idjmm9olljduofdam</string>
    <string>com-google-gidconsent-google</string>
    <string>com-google-gidconsent-youtube</string>
    <string>com-google-gidconsent</string>
    <string>com.google.gppconsent.2.4.1</string>
    <string>com.google.gppconsent.2.4.0</string>
    <string>googlechrome</string>
    <string>googlechrome-x-callback</string>
</array>

      

+1


source







All Articles