Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[google_sign_in] Add doc for iOS auth with SERVER_CLIENT_ID #4747

Merged
merged 8 commits into from
Jan 28, 2023
3 changes: 2 additions & 1 deletion packages/google_sign_in/google_sign_in/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## NEXT
## 5.4.4

* Adds documentation for iOS auth with SERVER_CLIENT_ID
* Updates minimum Flutter version to 3.0.

## 5.4.3
Expand Down
16 changes: 11 additions & 5 deletions packages/google_sign_in/google_sign_in/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ This plugin requires iOS 9.0 or higher.
5. Select `GoogleService-Info.plist` from the file manager.
6. A dialog will show up and ask you to select the targets, select the `Runner`
target.
7. Then add the `CFBundleURLTypes` attributes below into the
7. If you need to authenticate to a backend server you can add a
`SERVER_CLIENT_ID` key value pair in your `GoogleService-Info.plist`.
```xml
<key>SERVER_CLIENT_ID</key>
<string>[YOUR SERVER CLIENT ID]</string>
```
8. Then add the `CFBundleURLTypes` attributes below into the
`[my_project]/ios/Runner/Info.plist` file.

```xml
Expand All @@ -65,9 +71,9 @@ This plugin requires iOS 9.0 or higher.
<!-- End of the Google Sign-in Section -->
```

As an alternative to adding `GoogleService-Info.plist` to your Xcode project, you can instead
configure your app in Dart code. In this case, skip steps 3-6 and pass `clientId` and
`serverClientId` to the `GoogleSignIn` constructor:
As an alternative to adding `GoogleService-Info.plist` to your Xcode project,
you can instead configure your app in Dart code. In this case, skip steps 3 to 7
and pass `clientId` and `serverClientId` to the `GoogleSignIn` constructor:

```dart
GoogleSignIn _googleSignIn = GoogleSignIn(
Expand All @@ -79,7 +85,7 @@ GoogleSignIn _googleSignIn = GoogleSignIn(
);
```

Note that step 7 is still required.
Note that step 8 is still required.

#### iOS additional requirement

Expand Down
3 changes: 1 addition & 2 deletions packages/google_sign_in/google_sign_in/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system
for signing in with a Google account on Android and iOS.
repository: https://github.com/flutter/plugins/tree/main/packages/google_sign_in/google_sign_in
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
version: 5.4.3

version: 5.4.4

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down