iOS setup
The Info.plist keys read the .env values as build settings:
Info.plist
<key>GIDClientID</key>
<string>$(GOOGLE_IOS_CLIENT_ID)</string>
<key>GIDServerClientID</key>
<string>$(GOOGLE_WEB_CLIENT_ID)</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>$(GOOGLE_IOS_URL_SCHEME)</string>
</array>
</dict>
</array>
:::info Missing URL scheme
Without the URL scheme, sign-in rejects with DEVELOPER_ERROR instead of crashing with an Objective-C exception.
:::
Read .env through an xcconfig
KEY=value lines are valid xcconfig settings, so an xcconfig can include the root .env directly. Set it as the base configuration of the app target:
ios/GoogleSignIn.xcconfig
#include? "../.env"
The ? makes the include optional, so the project still builds on a fresh clone without .env.
Fallbacks and URL handling
- Without
GIDClientID, the iOS client ID falls back toCLIENT_IDin a bundled FirebaseGoogleService-Info.plist. - The SDK uses
ASWebAuthenticationSession, so the app delegate needs no URL handling.
Next
Android setup, or skip to the quick start.