google/googlesignin-ios
Get users into your apps quickly and securely, using a registration system they
Getting Started
Try either the Objective-C or Swift sample app. For example, to demo the Objective-C sample project, you have two options:
- Using CocoaPod's
installmethod:
git clone https://github.com/google/GoogleSignIn-iOS
cd GoogleSignIn-iOS/Samples/ObjC/SignInSample/
pod install
open SignInSampleForPod.xcworkspace- Using Swift Package Manager:
git clone https://github.com/google/GoogleSignIn-iOS
open GoogleSignIn-iOS/Samples/ObjC/SignInSample/SignInSample.xcodeprojIf you would like to see a Swift example, take a look at Samples/Swift/DaysUntilBirthday.
- Add Google Sign-In to your own app by following our
- Take a look at the
Google Sign-In on macOS
Google Sign-In allows your users to sign-in to your native macOS app using their Google account and default browser. When building for macOS, the signInWithConfiguration: and addScopes: methods take a presentingWindow: parameter in place of presentingViewController:. Note that in order for your macOS app to store credentials via the Keychain on macOS, you will need to add $(AppIdentifierPrefix)$(CFBundleIdentifier) as the first item in its keychain access group.
Mac Catalyst
Google Sign-In also supports iOS apps that are built for macOS via Mac Catalyst. In order for your Mac Catalyst app to store credentials via the Keychain on macOS, you will need to add $(AppIdentifierPrefix)$(CFBundleIdentifier) as the first item in the keychain access group.
A Note on iOS Keychain Access Groups
GSI uses your default (first listed) keychain access group. If you don't add a custom keychain access group, the default keychain access group is provided by Xcode and looks like $(AppIdentifierPrefix)$(CFBundleIdentifier).
GSI removes keychain items upon fresh install to ensure that stale credentials from previous installs of your app are not mistakenly used. If your app uses a shared access group by default this may lead to new installs of apps sharing the same keychain access group to remove keychain credentials for apps already installed.
To prevent unintentional credential removal, you can explicitly list the typical default access group (or whatever you prefer so long as it is not shared) in your list first. GSI, will then use that default access group.
Package Metadata
Repository: google/googlesignin-ios
Default branch: main
README: README.md