Skip to content

Commit 0f392ac

Browse files
chingjunsanekyy
authored andcommitted
[google_sign_in] Pass the client id to the platform interface. (flutter#2427)
The param exists in the platform interface but there was no way to pass anything to clientId through the external interface.
1 parent ed43957 commit 0f392ac

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

packages/google_sign_in/google_sign_in/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.1.1
2+
3+
* Support passing `clientId` to the web plugin programmatically.
4+
15
## 4.1.0
26

37
* Support web by default.

packages/google_sign_in/google_sign_in/lib/google_sign_in.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ class GoogleSignIn {
165165
this.signInOption = SignInOption.standard,
166166
this.scopes = const <String>[],
167167
this.hostedDomain,
168+
this.clientId,
168169
});
169170

170171
/// Factory for creating default sign in user experience.
@@ -207,6 +208,9 @@ class GoogleSignIn {
207208
/// Domain to restrict sign-in to.
208209
final String hostedDomain;
209210

211+
/// Client ID being used to connect to google sign-in. Only supported on web.
212+
final String clientId;
213+
210214
StreamController<GoogleSignInAccount> _currentUserController =
211215
StreamController<GoogleSignInAccount>.broadcast();
212216

@@ -240,6 +244,7 @@ class GoogleSignIn {
240244
signInOption: signInOption,
241245
scopes: scopes,
242246
hostedDomain: hostedDomain,
247+
clientId: clientId,
243248
)..catchError((dynamic _) {
244249
// Invalidate initialization if it errors out.
245250
_initialization = null;

packages/google_sign_in/google_sign_in/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: google_sign_in
22
description: Flutter plugin for Google Sign-In, a secure authentication system
33
for signing in with a Google account on Android and iOS.
44
homepage: https://github.com/flutter/plugins/tree/master/packages/google_sign_in/google_sign_in
5-
version: 4.1.0
5+
version: 4.1.1
66

77
flutter:
88
plugin:

0 commit comments

Comments
 (0)