EddyVerbruggen / cordova-plugin-googleplus

:heavy_plus_sign: Cordova plugin to login with Google Sign-In on iOS and Android
567 stars 629 forks source link

Google Plus window not loading! #82

Open ullasmohan opened 9 years ago

ullasmohan commented 9 years ago

Am using cordova-plugin-googleplus plugin for my "ionic iOS" app. But when i try to open google plus login i always getting an error like

"WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: Your app must support the following URL schemes: com.app.test, com.googleusercontent.apps.341564304804-34qnbg69vdmfon5b0ja5tutqta3n3l9h"

I feel i missed something but i lost my 12 hours for make it works but still having same issue.. please help.. :-(

bau720123 commented 9 years ago

hi @ullasmohan you have the 100% same problem just like me https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/104 hope @EddyVerbruggen can solve this

EddyVerbruggen commented 9 years ago

Hi @ullasmohan can you check your app's .plist file in platforms/ios? It should contain a section with CFBundleURLTypes values.

Also, on iOS9 it seems we also need a section with LSApplicationQueriesSchemes which I will add later today.

bau720123 commented 9 years ago

hi @EddyVerbruggen thanks your reply and sorry for the bother I feedback my Info.plist content first

<key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb197653916921532</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLName</key>
            <string>io.cordova.hellocordova</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>io.cordova.hellocordova</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLName</key>
            <string>REVERSED_CLIENT_ID</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>com.googleusercontent.apps.909119150051-0g74v62g7ifqf1qflvejg1lvf62ih16j</string>
            </array>
        </dict>
    </array>

and...you can search the keyword "REVERSED_CLIENT_ID"、"CFBundleURLSchemes"

EddyVerbruggen commented 9 years ago

@bau720123 Perhaps Facebook is clashing - can you remove that and try again? Also, please try the latest version which adds whitelisting, but that's really only relevant for iOS9.

bau720123 commented 9 years ago

hi @EddyVerbruggen after I remove the Facebook plugin from config.xml

<gap:plugin name="nickreed.com.phonegap.plugins.facebookconnect" source="plugins.cordova.io" version="0.11.1">
 <param name="APP_ID" value="111112222333" />
 <param name="APP_NAME" value="myappname" />
</gap:plugin>

my Info.plist content become these

<key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLName</key>
            <string>com.littlebau.phonegap</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>com.littlebau.phonegap</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLName</key>
            <string>REVERSED_CLIENT_ID</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>com.googleusercontent.apps.909119150051-0g74v62g7ifqf1qflvejg1lvf62ih16j</string>
            </array>
        </dict>
    </array>

finally... the "login" and "trySilentLogin" method all work perfect in iOS

Moussawi7 commented 9 years ago

Hi @EddyVerbruggen , I already installed the latest version, and encountered exactly the same issue.

this is my .plist file:

<key>CFBundleURLTypes</key>
    <array>
      <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>com.xxx.xxxApp</string>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>com.xxx.xxxApp</string>
        </array>
      </dict>
      <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>REVERSED_CLIENT_ID</string>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>com.googleusercontent.apps.1234567890-abcdefghijklmnopqrstuvwxyz</string>
        </array>
      </dict>
      <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>com.xxx.xxxApp</string>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>com.xxx.xxxApp</string>
        </array>
      </dict>
      <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>REVERSED_CLIENT_ID</string>
        <key>CFBundleURLSchemes</key>
        <array>
          <string>com.googleusercontent.apps.1234567890-abcdefghijklmnopqrstuvwxyz</string>
        </array>
      </dict>
    </array>
    <key>LSApplicationQueriesSchemes</key>
    <array>
      <string>com.xxx.xxxApp</string>
      <string>com.googleusercontent.apps.1234567890-abcdefghijklmnopqrstuvwxyz</string>
      <string>com-google-gidconsent</string>
      <string>com-google-gidconsent-google</string>
      <string>com.google.gppconsent.2.4.0</string>
      <string>com.google.gppconsent.2.4.1</string>
    </array>

it seem that a part is repeated. Thank you.

sammugg commented 8 years ago

Hey @ullasmohan and @bau720123,

I just merged a significant update yesterday that updated the Android side to use Google Sign-In and refactored plugin usage. The current documentation is up to date with those changes. You should check it out. Let me know if you have any questions!

~Sam P.S. If your issue gets resolved, please close it!