Problems with confusing URL schemes (iOS)
alexp25 opened this issue · 3 comments
I am constantly getting errors trying to configure this plugin on Capacitor iOS platform.
Could you clarify what each of the errors mean in terms of incorrect configuration? What error appears on what configuration (and what configuration is correct?)
It's not clear to me:
- what do I need to put in Podfile as CFBundleURLSchemes: web client id (xxxxxx-xxxxxxxxxxxxxxxxxx.apps.googleusercontent.com) / iOS client id (xxxxxx-yyyyyyyyyyyyyyyyyy.apps.googleusercontent.com) / reversed client id (com.googleusercontent.apps.xxxxxx-yyyyyyyyyyyyyyyyyy) ?
- what do I need to put in capacitor.config and what do I need to put in the initialize method options (and would they have to be the same as in the Podfile / which one / reversed?)
- what is serverClientId? Is it the same as web client id? (and why would I need them both? and what is clientId in this case?)
Also, having built the app, and running (but authentication not working), when I try to upload on TestFlight, I get this error:
The following URL schemes found in your app are not in the correct format: [xxxxxx-yyyyyyyyyyyyyyyyyy.apps.googleusercontent.com]. URL schemes need to begin with an alphabetic character, and be comprised of alphanumeric characters, the period, the hyphen or the plus sign only. Please see RFC1738 for more detail.
So it's the other way around? But then the app crashes.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Your app is missing support for the following URL schemes: xxxxxx-yyyyyyyyyyyyyyyyyy.apps.googleusercontent.com'
Figured it out that I had to use the reversed URL scheme in the Info.plist
, and the non-reversed URL scheme in the plugin config, both of them for iOS, not web client IDs. Very confusing... this needs better documentation and explicit examples in the Readme.