Google Sign-In crashes on iOS 9 attempting to call canOpenURL Google Sign-In crashes on iOS 9 attempting to call canOpenURL ios ios

Google Sign-In crashes on iOS 9 attempting to call canOpenURL


iOS 9 has introduced new changes to canOpenURL requiring the application to whitelist all the schemes it needs to query.

This post on Quick Take on iOS 9 URL Scheme Changes explains why.

At a minimum you need to whitelist you own application’s identifier and your Google OAuth apps id in Info.plist under LSApplicationQueriesSchemes. You can also whitelist the other schemes Google Sign-In queries to silence the other warnings.

<key>LSApplicationQueriesSchemes</key><array>    <string>com.example.foo</string>    <string>com.googleusercontent.apps.1234567890-abcdefghijklmnopqrstuvwxyz</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>


Just follow the steps in: https://developers.google.com/identity/sign-in/ios/start-integrating#add_url_schemes_to_your_project (including adding the schemes) and it should be working fine.

And, as requested by comments below, I'll emphasise that the problem probably occurred by not adding the URL schemes as described in the link above.

Quoting from the link above:

Google Sign-in requires two custom URL Schemes to be added to your project.

To add the custom schemes:

  1. Open your 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.
  2. Click the + button, and add a URL scheme for your reversed client ID. To find this value, open the GoogleService-Info.plist configuration file, and look for the REVERSED_CLIENT_ID key. Copy the value of that key, and paste it into the URL Schemes box on the configuration page. Leave the other fields blank.
  3. Click the + button, and add a second URL scheme. This one is the same as your app's bundle ID. For example, if your bundle ID is com.example.app, type that value into the URL Schemes box. You can find your app's bundle ID in the General tab of the project configuration (Identity > Bundle Identifier).


Updated for XCode 7.0 and Google plus Sdk 1.7.1

<key>LSApplicationQueriesSchemes</key>    <array>        <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>        <string>hasgplus4</string>        <string>com.google.gppconsent.2.3.0</string>        <string>com.google.gppconsent.2.2.0</string>        <string>com.google.gppconsent</string>    </array>

Reference Taken from this link


matomo