Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
1914008
Add a sign-in field to allow Android clients to explicitly specify an…
neilself Feb 5, 2025
bdfe492
Update the changelog.
neilself Feb 5, 2025
bedfeeb
Merge branch 'android_account_name' of ../flutter into android_accoun…
neilself Feb 5, 2025
ccd527a
Minor updates to fix broken checks/tests.
neilself Feb 6, 2025
27f8b32
Fix string formatting in GoogleSignInTest.
neilself Feb 6, 2025
6c71c01
Fix additional string formatting in GoogleSignInTest.
neilself Feb 6, 2025
9265495
Format files that needed formatting.
neilself Feb 6, 2025
97ada7f
Additional formatting fixes for java files.
neilself Feb 6, 2025
596cf34
Specify NDK version according to checks.
neilself Feb 7, 2025
fc18808
Update GoogleSignInTest to fix a broken test.
neilself Feb 8, 2025
1e57cc2
Update GoogleSignInTest.init_PassesForceAccountName() to use MockedCo…
neilself Feb 12, 2025
c9b1f5a
Merge branch 'main' into android_account_name
neilself Feb 12, 2025
2e91e38
Fix missing import of Account.
neilself Feb 12, 2025
c256020
Merge remote-tracking branch 'origin/android_account_name' into andro…
neilself Feb 12, 2025
923d2da
Update formatting within GoogleSignInTest.
neilself Feb 12, 2025
c00f5d3
Override dependencies in extension_google_sign_in_as_googleapis_auth …
neilself Feb 12, 2025
80b054a
Override dependency in extension_google_sign_in_as_googleapis_auth du…
neilself Feb 13, 2025
964bb35
Merge branch 'main' into android_account_name
neilself Feb 13, 2025
68a2032
Override dependency in extension_google_sign_in_as_googleapis_auth/ex…
neilself Feb 13, 2025
9327b58
Update version/CHANGELOG for google_sign_in_ios and extension_google_…
neilself Feb 13, 2025
914829a
Merge branch 'main' into android_account_name
neilself Feb 13, 2025
41e0456
Merge branch 'main' into android_account_name
neilself Feb 14, 2025
802641e
Merge branch 'main' into android_account_name
neilself Feb 19, 2025
6d4c314
Update isNullOrEmpty() usage to match new convention.
neilself Feb 20, 2025
473b5e7
Revert changes to extension_google_sign_in_as_googleapis_auth package.
neilself Feb 21, 2025
c4fd24c
Minor updates to respond to PR review comments.
neilself Feb 21, 2025
16438e2
Revert changes in the extension_google_sign_in_as_googleapis_auth pac…
neilself Feb 21, 2025
1acd588
Revert changes in method_channel_google_sign_in.dart and its test file.
neilself Feb 21, 2025
18af989
Updates the CHANGELOG for google_sign_in_android to better follow the…
neilself Feb 21, 2025
99a101f
Merge branch 'main' into android_account_name
neilself Feb 21, 2025
9476549
Update exception type in google_sign_in_ios_test to match new excepti…
neilself Feb 21, 2025
c694668
Merge branch 'main' into android_account_name
neilself Feb 21, 2025
21282bd
Merge branch 'main' into android_account_name
neilself Feb 25, 2025
2de2130
Merge branch 'main' into android_account_name
neilself Feb 27, 2025
fca4991
Update version number for google_sign_in_ios and some comment languag…
neilself Feb 28, 2025
baccfbb
Merge remote-tracking branch 'origin/android_account_name' into andro…
neilself Feb 28, 2025
117ca4b
'Revert' changes to origin/main for google_sign_in_platform_interface…
neilself Mar 3, 2025
a3885ef
Update pubspec.yaml files in google_sign_in to remove dependency over…
neilself Mar 3, 2025
bf9c0f1
Merge branch 'main' into android_account_name
neilself Mar 4, 2025
697c55d
Update formatting in Messages.java to match convention.
neilself Mar 4, 2025
62e377b
Merge remote-tracking branch 'origin/android_account_name' into andro…
neilself Mar 4, 2025
b6dfff8
Merge branch 'main' into android_account_name
neilself Mar 6, 2025
b3e66a4
Update implementation dependency versions for app-facing package so t…
neilself Mar 7, 2025
0438170
Merge branch 'main' into android_account_name
neilself Mar 7, 2025
4df5d80
Bump SDK requirements to match deps
stuartmorgan-g Mar 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 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,7 @@
## NEXT
## 6.3.0

* Adds a sign-in field to allow Android clients to explicitly specify an account name. This
capability is only available within Android for the underlying libraries.
* Updates minimum supported SDK version to Flutter 3.22/Dart 3.4.

## 6.2.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ class GoogleSignIn {
this.clientId,
this.serverClientId,
this.forceCodeForRefreshToken = false,
this.forceAccountName,
}) {
// Start initializing.
if (kIsWeb) {
Expand Down Expand Up @@ -263,6 +264,9 @@ class GoogleSignIn {
/// Force the authorization code to be valid for a refresh token every time. Only needed on Android.
final bool forceCodeForRefreshToken;

/// Explicitly specifies the account name to be used in sign-in. Must only be set on Android.
final String? forceAccountName;

final StreamController<GoogleSignInAccount?> _currentUserController =
StreamController<GoogleSignInAccount?>.broadcast();

Expand Down Expand Up @@ -317,6 +321,7 @@ class GoogleSignIn {
clientId: clientId,
serverClientId: serverClientId,
forceCodeForRefreshToken: forceCodeForRefreshToken,
forceAccountName: forceAccountName,
));

unawaited(GoogleSignInPlatform.instance.userDataEvents
Expand Down
14 changes: 7 additions & 7 deletions packages/google_sign_in/google_sign_in/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ description: Flutter plugin for Google Sign-In, a secure authentication system
for signing in with a Google account.
repository: https://github.com/flutter/packages/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: 6.2.2
version: 6.3.0

environment:
sdk: ^3.4.0
flutter: ">=3.22.0"
sdk: ^3.6.0
flutter: ">=3.27.0"

flutter:
plugin:
Expand All @@ -24,10 +24,10 @@ flutter:
dependencies:
flutter:
sdk: flutter
google_sign_in_android: ^6.1.0
google_sign_in_ios: ^5.7.0
google_sign_in_platform_interface: ^2.4.0
google_sign_in_web: ^0.12.0
google_sign_in_android: ^6.2.0
google_sign_in_ios: ^5.8.1
google_sign_in_platform_interface: ^2.5.0
google_sign_in_web: ^0.12.4+4

dev_dependencies:
build_runner: ^2.1.10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@ void main() {
verify(mockPlatform.signIn());
});

test('forceAccountName sent with init method call', () async {
final GoogleSignIn googleSignIn =
GoogleSignIn(forceAccountName: '[email protected]');

await googleSignIn.signIn();

_verifyInit(mockPlatform,
forceAccountName: '[email protected]');
verify(mockPlatform.signIn());
});

test('signOut', () async {
final GoogleSignIn googleSignIn = GoogleSignIn();

Expand Down Expand Up @@ -447,6 +458,7 @@ void _verifyInit(
String? clientId,
String? serverClientId,
bool forceCodeForRefreshToken = false,
String? forceAccountName,
}) {
verify(mockSignIn.initWithParams(argThat(
isA<SignInInitParameters>()
Expand Down Expand Up @@ -479,6 +491,11 @@ void _verifyInit(
(SignInInitParameters p) => p.forceCodeForRefreshToken,
'forceCodeForRefreshToken',
forceCodeForRefreshToken,
)
.having(
(SignInInitParameters p) => p.forceAccountName,
'forceAccountName',
forceAccountName,
),
)));
}