cordova-plugin-googleplus icon indicating copy to clipboard operation
cordova-plugin-googleplus copied to clipboard

Could not find url scheme in app .plist

Open t-roymyers opened this issue 5 years ago • 31 comments

I've used this plugin multiple times in the past, however this time on Ionic 4. I installed the plugin as usual and I know I implemented the REVERSED_CLIENT_ID variable correctly but when I run it on iOS I get the error:

"Could not find REVERSED_CLIENT_ID url scheme in app .plist"

Does anybody have any idea how to move forward?

Thanks!

t-roymyers avatar Jul 18 '19 18:07 t-roymyers

Im having the same issue, did you sort it out @tmyers97 ?

I'm using Cordova 9 and Cordova iOS 5.0.1

aetchegoyen avatar Jul 24 '19 14:07 aetchegoyen

@tmyers97 I fixed it, manually for now, but I'll find a way to fix the plugin or automate the process and get back to you.

  1. Navigate to platforms/ios/
  2. Open Podfile
  3. Check if you have a line with pod 'GoogleSignIn', if you don't, then add it.
  4. Do a pod install from your terminal
  5. Open your project using the .xcworkspace file
  6. Go to the Info tab and then to URL Types
  7. Check if you have your REVERSED_CLIENT_ID set up, if you don't add it as follow: image

And it will work.

aetchegoyen avatar Jul 25 '19 08:07 aetchegoyen

@EddyVerbruggen It seems that for some reason the Pod 'GoogleSignIn' dependency and REVERSED_CLIENT_ID Url Scheme are not being injected automatically by the plugin during installation. My current environment is:

[email protected] [email protected] [email protected] Xcode 10.3 [email protected]

aetchegoyen avatar Jul 25 '19 08:07 aetchegoyen

If you are using google login with facebook login (for example) you need to add them in separate dict. Here is my working version in config.xml file: <config-file parent="CFBundleURLTypes" target="*-Info.plist"> <array> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLName</key> <string>REVERSED_CLIENT_ID</string> <key>CFBundleURLSchemes</key> <array> <string>com.googleusercontent.apps.123</string> </array> </dict> <dict> <key>CFBundleURLSchemes</key> <array> <string>myapp</string> <string>fb12345</string> </array> </dict> </array> </config-file>

rzy77 avatar Aug 02 '19 13:08 rzy77

@rzy77 did you make changes to both plugins' plugin.xml files, or just to you main config.xml file?

fariazz avatar Sep 03 '19 21:09 fariazz

@fariazz I made the changes above only to the config.xml file.

rzy77 avatar Sep 04 '19 08:09 rzy77

Still experiencing this issue with v8.1.1 on cordova-ios 5.0.1

ArcadeMode avatar Sep 12 '19 15:09 ArcadeMode

Still experiencing this issue with v8.1.1 on cordova-ios 5.0.1

Me too!

mateusduraes avatar Sep 17 '19 09:09 mateusduraes

Me too.

ambu50 avatar Sep 23 '19 21:09 ambu50

Also experiencing this with v8.1.1/cordova-ios 5.0.1

gerardva avatar Sep 26 '19 09:09 gerardva

Any update on this?

ArcadeMode avatar Oct 09 '19 13:10 ArcadeMode

I am experiencing this when cordova-plugin-facebook4 is installed alongside this plugin.

Here is my Info plist before without cordova-plugin-facebook4:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>en_US</string>
	<key>CFBundleDisplayName</key>
	<string>Pony</string>
	<key>CFBundleExecutable</key>
	<string>$(EXECUTABLE_NAME)</string>
	<key>CFBundleIdentifier</key>
	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>$(PRODUCT_NAME)</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0.0</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1.0.0</string>
	<key>LSRequiresIPhoneOS</key>
	<true/>
	<key>NSMainNibFile</key>
	<string/>
	<key>NSMainNibFile~ipad</key>
	<string/>
	<key>UIRequiresFullScreen</key>
	<true/>
	<key>UISupportedInterfaceOrientations</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>
	<key>UISupportedInterfaceOrientations~ipad</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationPortraitUpsideDown</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>
	<key>NSAppTransportSecurity</key>
	<dict>
		<key>NSExceptionDomains</key>
		<dict>
			<key>accounts.google.com</key>
			<dict/>
		</dict>
		<key>NSAllowsArbitraryLoads</key>
		<true/>
	</dict>
	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
			<key>CFBundleURLName</key>
			<string>REVERSED_CLIENT_ID</string>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>com.googleusercontent.apps.myid</string>
			</array>
		</dict>
	</array>
</dict>
</plist>

and here is the plist with the facebook plugin installed:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>en_US</string>
	<key>CFBundleDisplayName</key>
	<string>Pony</string>
	<key>CFBundleExecutable</key>
	<string>$(EXECUTABLE_NAME)</string>
	<key>CFBundleIdentifier</key>
	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>$(PRODUCT_NAME)</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0.0</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1.0.0</string>
	<key>LSRequiresIPhoneOS</key>
	<true/>
	<key>NSMainNibFile</key>
	<string/>
	<key>NSMainNibFile~ipad</key>
	<string/>
	<key>UIRequiresFullScreen</key>
	<true/>
	<key>UISupportedInterfaceOrientations</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>
	<key>UISupportedInterfaceOrientations~ipad</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationPortraitUpsideDown</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>
	<key>NSAppTransportSecurity</key>
	<dict>
		<key>NSExceptionDomains</key>
		<dict>
			<key>m.facebook.com</key>
			<dict/>
			<key>graph.facebook.com</key>
			<dict/>
			<key>api.facebook.com</key>
			<dict/>
			<key>fbcdn.net</key>
			<dict>
				<key>NSIncludesSubdomains</key>
				<true/>
			</dict>
			<key>akamaihd.net</key>
			<dict>
				<key>NSIncludesSubdomains</key>
				<true/>
			</dict>
			<key>accounts.google.com</key>
			<dict/>
		</dict>
		<key>NSAllowsArbitraryLoads</key>
		<true/>
	</dict>
	<key>FacebookAppID</key>
	<string>myid</string>
	<key>FacebookDisplayName</key>
	<string>Pony</string>
	<key>FacebookHybridAppEvents</key>
	<string>false</string>
	<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>myid</string>
			</array>
		</dict>
	</array>
	<key>LSApplicationQueriesSchemes</key>
	<array>
		<string>fbapi</string>
		<string>fb-messenger-api</string>
		<string>fbauth2</string>
		<string>fbshareextension</string>
	</array>
</dict>
</plist>

you see the CFBundleURLSchemes entry is wiped.

dminkovsky avatar Oct 29 '19 21:10 dminkovsky

Could not get adding to config.xml to work as suggested by @rzy77 (was never copied info.plist – Ionic 4 / Angular project) but adding manually as @aetchegoyen suggested worked fine for me – thanks!

Ionic: Ionic CLI : 5.4.6 (/usr/local/lib/node_modules/ionic) Ionic Framework : @ionic/angular 4.11.1 @angular-devkit/build-angular : 0.801.3 @angular-devkit/schematics : 8.1.3 @angular/cli : 8.1.3 @ionic/angular-toolkit : 2.0.0

Cordova: Cordova CLI : 9.0.0 ([email protected]) Cordova Platforms : ios 5.0.1 Cordova Plugins : cordova-plugin-ionic-webview 4.1.1, (and 7 other plugins)

Utility: cordova-res : 0.6.0 (update available: 0.8.1) native-run : 0.2.8 (update available: 0.2.9)

System: Android SDK Tools : 26.1.1 (/Users/maxfloden/Library/Android/sdk) ios-deploy : 1.9.4 ios-sim : 8.0.2 NodeJS : v10.16.3 (/usr/local/bin/node) npm : 6.13.0 OS : macOS Catalina Xcode : Xcode 11.2.1 Build version 11B500

maxfloden avatar Nov 19 '19 14:11 maxfloden

I have the same issue! The problem only happens if I use both facebook4 and google plus plugins. It is weird as a week ago with no changes this issue did not happen.

deliverymanager avatar Nov 21 '19 20:11 deliverymanager

If you are using google login with facebook login (for example) you need to add them in separate dict. Here is my working version in config.xml file: <config-file parent="CFBundleURLTypes" target="*-Info.plist"> ..... </config-file>

This seems to work. The only thing is that this duplicates FB value and it presents twice in *-Info.plist. For example, here is what I have after adding the above workaround

		<dict>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>myapp</string>
				<string>fb12345</string>
			</array>
		</dict>
		<dict>
			<key>CFBundleURLSchemes</key>
			<array>
				<string>fb12345</string>
			</array>
		</dict>

But this seems to work and does not break anything.

ryaa avatar Jan 03 '20 15:01 ryaa

@tmyers97 I fixed it, manually for now, but I'll find a way to fix the plugin or automate the process and get back to you.

  1. Navigate to platforms/ios/
  2. Open Podfile
  3. Check if you have a line with pod 'GoogleSignIn', if you don't, then add it.
  4. Do a pod install from your terminal
  5. Open your project using the .xcworkspace file
  6. Go to the Info tab and then to URL Types
  7. Check if you have your REVERSED_CLIENT_ID set up, if you don't add it as follow: image

And it will work.

Life saver! Thank you

iconio avatar Jan 13 '20 01:01 iconio

Is there a known proper fix for this yet?

foxbunny avatar Jan 16 '20 09:01 foxbunny

@tmyers97 I fixed it, manually for now, but I'll find a way to fix the plugin or automate the process and get back to you.

  1. Navigate to platforms/ios/
  2. Open Podfile
  3. Check if you have a line with pod 'GoogleSignIn', if you don't, then add it.
  4. Do a pod install from your terminal
  5. Open your project using the .xcworkspace file
  6. Go to the Info tab and then to URL Types
  7. Check if you have your REVERSED_CLIENT_ID set up, if you don't add it as follow: image

And it will work.

I'm using facebook4 plugin as well and this resolved the issue for me.

cordova-ios 5.1.1 googleplus 8.2.1 facebook4 6.2.0

sahyun1 avatar Jan 23 '20 03:01 sahyun1

All,

To anyone encountering this issue, please check here: https://github.com/apache/cordova-common/issues/88

to see if that is your issue. I'd bet it is.

codinronan avatar Mar 11 '20 00:03 codinronan

Hey guys,

same issue here, using facebook4 plugin as well. I fixed the issue couple of weeks ago by doing as advised by @aetchegoyen . Since then I installed a few more plugins, and now when I manually add the REVERSED_CLIENT_ID, I get following error in xcode when trying to log-in with google in the app:

Assertion failure in +[OIDScopeUtilities scopesWithArray:], /platforms/ios/Pods/AppAuth/Source/OIDScopeUtilities.m:44 CRASH: Found illegal empty scope string.

Any help would be greatly appreciated. I already spent like 2 days trying to figure it out, but cannot get my head around that.

adammurin avatar Mar 13 '20 16:03 adammurin

Hi, I have the same problem @adammurin.

lrobak0 avatar Mar 17 '20 07:03 lrobak0

Here the same as @adammurin

BrutussMaximus avatar Mar 26 '20 13:03 BrutussMaximus

same problem @adammurin.

mohamedsharaf avatar Apr 03 '20 22:04 mohamedsharaf

Hi I also have the same issue as @adammurin Is there any solution?

I don't use facebook plugin, but I have firebaseX.

By default the URL TYPE is completely missing, and I get the "Could not find REVERSED_CLIENT_ID url scheme in app .plist" error, if I add it manually including the Identifier: REVERSED_CLIENT_ID I get the error "CRASH: Found illegal empty scope string.". If I add only the URL scheme without the identifier as some suggested I still get the Could not find error.

MrFragStealer avatar Apr 17 '20 11:04 MrFragStealer

Hi Guys,

I already spent like 5 days with this problem and finally i found the solution.

this.googlePlus.login({ 'scopes': 'email', // optional, space-separated list of scopes, If not included or empty, defaults to profileandemail. 'webClientId': '', // optional clientId of your Web application from Credentials settings of your project - On Android, this MUST be included to get an idToken. On iOS, it is not required. 'offline': true })

Add at least one scope (got it ? 'Found illegal empty scope string') and leave the webClientId empty, even for android.

Works like a charm after that.

Also install the Eddy plugin from github.

$ cordova plugin add https://github.com/EddyVerbruggen/cordova-plugin-googleplus --save --variable REVERSED_CLIENT_ID=myreversedclientid --variable WEB_APPLICATION_CLIENT_ID=mywebapplicationclientid

ligues avatar Apr 21 '20 19:04 ligues

Thank you very much @ligues I had the same issue since several days, now it works perfectly by adding scopes.

mohamedZea avatar Apr 27 '20 23:04 mohamedZea

Based on additional research, it seems that the problem seems to be caused by the fact that some params (REVERSED_CLIENT_ID etc.) are not added to the appropriate plist file and not available when the app is running. For example, these must be present in <YOUR_APP_DIRECTORY>/platforms/ios/<APP_NAME>/<APP_NAME>-Info.plist

The problem is that some cordova plugins (for example, cordova-plugin-facebook4, cordova-plugin-googleplus etc.) use config-file tag in plugin.xml to update your *-Info.plist file and due to the bug in cordova (see apache/cordova-common#88) those changes are applied to the wrong plist file and not working.

The dirty and quick fix is to change the below line at 179 in <YOUR_APP_DIRECTORY>/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js file from

var plistName = getIOSProjectname(project_dir) + '-Info.plist'; to

var plistName = '/' + getIOSProjectname(project_dir) + '-Info.plist'; For more details about the fix please see apache/cordova-common#88 (comment)

IMPORTANT: it must be done before restoring/adding platforms and plugins or remove and restore platforms/plugins after this change is made.

ryaa avatar May 09 '20 04:05 ryaa

thank you @rzy77 for your post of aug 2, 2019, it worked perfectly. since i rely on ionic's appflow i needed a workaround that could be checked into github then pulled in by their vm and your suggestion did the trick.

bppearsoft avatar Aug 19 '20 00:08 bppearsoft

I use this sentence to add "URL Types" to IOS PLATFORM on Apache Cordova:

    <config-file target="*-Info.plist" parent="CFBundleURLTypes">
        <array>
            <dict>
                <key>CFBundleURLSchemes</key>
                    <array>
                        <string>**APP_NAME**</string>
                    </array>

                <key>CFBundleURLName</key>
                <string>**PACKAGE_ID**</string>
            </dict>
        </array>
    </config-file>

jasp255 avatar Sep 07 '20 07:09 jasp255

@ligues solution worked for me. Simply adding email to scope worked.

krishna711 avatar Feb 21 '22 04:02 krishna711