Viewing version 6.3.8. Open the latest package page.
google_sign_in_ios
6.3.8iOS implementation of the google_sign_in plugin.
Readme
google_sign_in_ios
The iOS and macOS implementation of google_sign_in.
Usage
This package is endorsed, which means you can simply use google_sign_in
normally. This package will be automatically included in your app when you do,
so you do not need to add it to your pubspec.yaml.
However, if you import this package to use any of its APIs directly, you
should add it to your pubspec.yaml as usual.
iOS integration
- Create a Firebase project and register your application.
- Enable Google Sign-In for your Firebase project.
- Make sure to download a new copy of your project's
GoogleService-Info.plistfrom step 2. Do not put this file in your project. - Add the client ID from the
GoogleService-Info.plistinto your app's[my_project]/ios/Runner/Info.plistfile.<key>GIDClientID</key> <!-- TODO Replace this value: --> <!-- Copied from GoogleService-Info.plist key CLIENT_ID --> <string>[YOUR IOS CLIENT ID]</string> - If you need to authenticate to a backend server you can add a
GIDServerClientIDkey value pair in your[my_project]/ios/Runner/Info.plistfile.<key>GIDServerClientID</key> <string>[YOUR SERVER CLIENT ID]</string> - Then add the
CFBundleURLTypesattributes below into the[my_project]/ios/Runner/Info.plistfile.
<!-- Put me in the [my_project]/ios/Runner/Info.plist file -->
<!-- Google Sign-in Section -->
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<!-- TODO Replace this value: -->
<!-- Copied from GoogleService-Info.plist key REVERSED_CLIENT_ID -->
<string>com.googleusercontent.apps.861823949799-vc35cprkp249096uujjn0vvnmcvjppkn</string>
</array>
</dict>
</array>
<!-- End of the Google Sign-in Section -->
As an alternative to editing the Info.plist in your Xcode project,
you can instead configure your app in Dart code. In this case, skip steps 4 and
5 and pass clientId and serverClientId to the GoogleSignIn initialization:
final GoogleSignInPlatform signIn = GoogleSignInPlatform.instance;
await signIn.init(
const InitParameters(
// The OAuth client ID of your app. This is required.
clientId: 'Your Client ID',
// If you need to authenticate to a backend server, specify the server's
// OAuth client ID. This is optional.
serverClientId: 'Your Server ID',
),
);
Note that step 6 is still required.
App Store requirements
Apple's App Review Guidelines impose
extra login option requirements
on apps that include Google Sign-In. Other packages, such as the Flutter Favorite
sign_in_with_apple, may
be useful in satisfying the review requirements.
macOS integration
Follow the steps above for iOS integration, but using the Info.plist in the
macos directory.
In addition, the GoogleSignIn SDK requires keychain sharing to be enabled, by adding the following entitlements:
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)com.google.GIDSignIn</string>
</array>
Without this step, the plugin will throw a keychain error PlatformException
when trying to sign in.
Changelog
6.3.8
- Removes the public iOS
handleOpenhelper. On macOShandleOpenremains public because it implementsFlutterAppLifecycleDelegate.
6.3.7
- Converts the plugin to Swift-only by removing the Objective-C exception catcher. SDK configuration failures now crash natively instead of being reported as Dart errors.
6.3.6
- Converts the Pigeon host API from Objective-C to Swift.
- Updates minimum supported SDK version to Flutter 3.41/Dart 3.11.
6.3.5
- Migrates ViewProvider and GID SDK wrappers from Objective-C to Swift.
- Returns an error when no host view is available to present Google Sign-In.
6.3.4
- Migrates the plugin class from Objective-C to Swift.
- Adds a CocoaPods placeholder header so the generated Swift header can import
google_sign_in_ios.h. - Fixes scene URL handling to report whether Google Sign-In handled the URL.
- Returns an error when Google Sign-In reports a user without a user ID.
6.3.3
- Creates Swift Package Manager target for Swift implementation.
6.3.2
- Updates pigeon dev_dependency to ^27.3.2 for analyzer 14 compatibility.
6.3.1
- Improves testability of iOS scene URL handling.
6.3.0
- Adds UIScene compatibility.
- Updates minimum supported SDK version to Flutter 3.38/Dart 3.10.
6.2.5
- Updates native header visibility for Swift testing.
6.2.4
- Updates to Pigeon 26.
6.2.3
- Internal restructuring to improve testability.
6.2.2
- Updates minimum supported version to iOS 13.
- Updates minimum supported SDK version to Flutter 3.35/Dart 3.9.
6.2.1
- Fixes a bug that would cause
serverAuthorizationTokensForScopesto return null even when called for a user that had just authenticated.
6.2.0
- Adds support for the
clearAuthorizationTokenmethod. - Updates minimum supported SDK version to Flutter 3.29/Dart 3.7.
6.1.0
- Updates to
GoogleSignIn9.0. - Adds support for the
nonceparameter.
6.0.1
- Returns configuration errors as
PlatformExceptions in Dart instead of crashing the app.
6.0.0
- BREAKING CHANGE: Switches to implementing version 3.0 of the platform interface package, rather than 2.x, significantly changing the API surface.
- Updates minimum supported SDK version to Flutter 3.27/Dart 3.6.
5.9.0
- Updates Google Sign-In SDK to 8.0+.
5.8.1
- Asserts that new
forceAccountNameparameter is null (not used in iOS).
5.8.0
- Updates minimum supported SDK version to Flutter 3.22/Dart 3.4.
- Adds Swift Package Manager compatibility.
5.7.8
- Updates Pigeon for non-nullable collection type support.
5.7.7
- Fixes "callee requires a non-null parameter" analyzer warning.
- Updates minimum supported SDK version to Flutter 3.19/Dart 3.3.
5.7.6
- Upgrades GoogleSignIn iOS SDK to 7.1.
5.7.5
- Pins GoogleSignIn to iOS SDK "7.0.0" while preparing the update to 7.1.
5.7.4
- Improves type handling in Objective-C code.
- Updates minimum iOS version to 12.0 and minimum Flutter version to 3.16.6.
5.7.3
- Adds privacy manifest.
5.7.2
- Updates
clearAuthCacheoverride to match base class declaration.
5.7.1
- Changes
pigeonto a dev dependency.
5.7.0
- Adds support for macOS.
- Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
5.6.5
- Upgrades GoogleSignIn iOS SDK to 7.0.
5.6.4
- Converts platform communication to Pigeon.
5.6.3
- Adds pub topics to package metadata.
- Updates minimum supported SDK version to Flutter 3.7/Dart 2.19.
5.6.2
- Updates functions without a prototype to avoid deprecation warning.
5.6.1
- Clarifies explanation of endorsement in README.
- Aligns Dart and Flutter SDK constraints.
5.6.0
- Updates minimum Flutter version to 3.3 and iOS 11.
5.5.2
- Updates links for the merge of flutter/plugins into flutter/packages.
- Updates minimum Flutter version to 3.0.
5.5.1
- Fixes passing
serverClientIdvia the channelledinitcall - Updates minimum Flutter version to 2.10.
5.5.0
- Adds override for
GoogleSignInPlatform.initWithParams.
5.4.0
- Adds support for
serverClientIdconfiguration option. - Makes
Google-Services.infofile optional.
5.3.1
- Suppresses warnings for pre-iOS-13 codepaths.
5.3.0
- Supports arm64 iOS simulators by increasing GoogleSignIn dependency to version 6.2.
5.2.7
- Fixes library_private_types_in_public_api, sort_child_properties_last and use_key_in_widget_constructors lint warnings.
5.2.6
- Switches to an internal method channel, rather than the default.
5.2.5
- Splits from
google_sign_inas a federated implementation.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'google_sign_in_ios:6.3.8'pubspec.yaml
name: google_sign_in_ios
description: iOS implementation of the google_sign_in plugin.
repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_ios
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
version: 6.3.8
environment:
sdk: ^3.11.0
flutter: ">=3.41.0"
flutter:
plugin:
implements: google_sign_in
platforms:
ios:
dartPluginClass: GoogleSignInIOS
pluginClass: GoogleSignInPlugin
sharedDarwinSource: true
macos:
dartPluginClass: GoogleSignInIOS
pluginClass: GoogleSignInPlugin
sharedDarwinSource: true
dependencies:
flutter:
sdk: flutter
google_sign_in_platform_interface: ^3.1.0
meta: ^1.10.0
dev_dependencies:
build_runner: ^2.4.6
flutter_test:
sdk: flutter
mockito: ^5.4.4
pigeon: ^27.3.2
topics:
- authentication
- google-sign-in
# The example deliberately includes limited-use secrets.
false_secrets:
- /darwin/Tests/GoogleService-Info.plist
- /darwin/Tests/GoogleSignInTests.swift
- /example/ios/Runner/Info.plist
- /example/lib/main.dart
- /example/macos/Runner/Info.plist
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 5.2.5 | On demand | Download | 7f3f6cc6…4e9300 |
| 5.2.6 | On demand | Download | 160ccbad…c501c3 |
| 5.2.7 | On demand | Download | 3d9299cd…9c8f47 |
| 5.3.0 | On demand | Download | e30e267c…1c5ea5 |
| 5.3.1 | On demand | Download | 35b1a9d3…9c597b |
| 5.4.0 | On demand | Download | 8b80074c…50f9f3 |
| 5.5.0 | On demand | Download | 673c0b07…fe955f |
| 5.5.1 | On demand | Download | 1116aff5…2a4e70 |
| 5.5.2 | On demand | Download | eca34337…2bb135 |
| 5.6.0 | On demand | Download | 2575ef0d…776c5c |
| 5.6.1 | On demand | Download | 2e1df687…e67403 |
| 5.6.2 | On demand | Download | 6ec0e13a…15a63e |
| 5.6.3 | On demand | Download | 8edfde96…10345b |
| 5.6.4 | On demand | Download | 97494485…4ff4ce |
| 5.6.5 | On demand | Download | 81495441…ff2e6d |
| 5.7.0 | On demand | Download | e050cd90…92b2d7 |
| 5.7.1 | On demand | Download | 0822b0ab…bcf90d |
| 5.7.2 | On demand | Download | b7d444ab…5e4d20 |
| 5.7.3 | On demand | Download | f3336d9e…b95226 |
| 5.7.4 | On demand | Download | a7d65380…203217 |
| 5.7.5 | On demand | Download | 1e0d4fde…fdd2e7 |
| 5.7.6 | On demand | Download | a058c988…2ca9fe |
| 5.7.7 | On demand | Download | 4898410f…f81ac7 |
| 5.7.8 | On demand | Download | 83f01516…ed228a |
| 5.8.0 | On demand | Download | 84684655…42379b |
| 5.8.1 | On demand | Download | 29cd125f…d6a2bd |
| 5.9.0 | On demand | Download | 102005f4…516c96 |
| 6.0.0 | On demand | Download | 59937a67…e55a0c |
| 6.0.1 | On demand | Download | 44032e86…b10ea3 |
| 6.1.0 | On demand | Download | c7ee744e…0055bc |
| 6.2.0 | On demand | Download | 10830fd3…56c973 |
| 6.2.1 | On demand | Download | d9d80f95…6db18c |
| 6.2.2 | On demand | Download | 4a9c1404…ba56c5 |
| 6.2.3 | On demand | Download | 0ba0b276…af68a7 |
| 6.2.4 | On demand | Download | aee8bb29…0b6ed7 |
| 6.2.5 | On demand | Download | 234fc283…3b8fb2 |
| 6.3.0 | On demand | Download | ac1e4c12…bb6950 |
| 6.3.1 | On demand | Download | 88dd743a…646180 |
| 6.3.2 | On demand | Download | 90a88665…6e8df0 |
| 6.3.3 | On demand | Download | 50ab85d3…b12d7e |
| 6.3.4 | On demand | Download | a5d84f64…785772 |
| 6.3.5 | On demand | Download | c2154d28…4c40b6 |
| 6.3.6 | On demand | Download | 55e8b7ea…9c3687 |
| 6.3.7 | On demand | Download | bba6717c…50d067 |
| 6.3.8 | Cached · Upstream SHA-256 matched | Download | b8efb315…6319ad |
Dependencies
flutter {
"sdk": "flutter"
}
google_sign_in_platform_interface "^3.1.0"
meta "^1.10.0"