cordova-plugin-googleplus
cordova-plugin-googleplus copied to clipboard
Could not find url scheme in app .plist
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!
Im having the same issue, did you sort it out @tmyers97 ?
I'm using Cordova 9 and Cordova iOS 5.0.1
@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.
- Navigate to platforms/ios/
- Open Podfile
- Check if you have a line with
pod 'GoogleSignIn'
, if you don't, then add it. - Do a
pod install
from your terminal - Open your project using the
.xcworkspace
file - Go to the Info tab and then to URL Types
- Check if you have your REVERSED_CLIENT_ID set up, if you don't add it as follow:
And it will work.
@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]
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 did you make changes to both plugins' plugin.xml files, or just to you main config.xml file?
@fariazz I made the changes above only to the config.xml file.
Still experiencing this issue with v8.1.1 on cordova-ios 5.0.1
Still experiencing this issue with v8.1.1 on cordova-ios 5.0.1
Me too!
Me too.
Also experiencing this with v8.1.1/cordova-ios 5.0.1
Any update on this?
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.
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
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.
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.
@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.
- Navigate to platforms/ios/
- Open Podfile
- Check if you have a line with
pod 'GoogleSignIn'
, if you don't, then add it.- Do a
pod install
from your terminal- Open your project using the
.xcworkspace
file- Go to the Info tab and then to URL Types
- Check if you have your REVERSED_CLIENT_ID set up, if you don't add it as follow:
![]()
And it will work.
Life saver! Thank you
Is there a known proper fix for this yet?
@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.
- Navigate to platforms/ios/
- Open Podfile
- Check if you have a line with
pod 'GoogleSignIn'
, if you don't, then add it.- Do a
pod install
from your terminal- Open your project using the
.xcworkspace
file- Go to the Info tab and then to URL Types
- Check if you have your REVERSED_CLIENT_ID set up, if you don't add it as follow:
![]()
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
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.
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.
Hi, I have the same problem @adammurin.
Here the same as @adammurin
same problem @adammurin.
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.
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
profileand
email. '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
Thank you very much @ligues I had the same issue since several days, now it works perfectly by adding scopes.
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.
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.
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>
@ligues solution worked for me. Simply adding email to scope worked.