Skip to content

Commit 2b0ecd2

Browse files
[google_sign_in] Add exception info to migration guide (#9574)
Adds discussion of the new exception flows to the migration guide. Also makes the API comment discussion of initialize more thorough Fixes flutter/flutter#171704 Fixes flutter/flutter#171746 ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
1 parent a86b6c9 commit 2b0ecd2

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

packages/google_sign_in/google_sign_in/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 7.1.1
2+
3+
* Adds more documentation about the requirement to call `initialize` exactly
4+
once.
5+
* Adds information about `GoogleSignInException` to the migration guide.
6+
17
## 7.1.0
28

39
* Adds the missing export of `GoogleSignInExceptionCode`, to allow for

packages/google_sign_in/google_sign_in/MIGRATION.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,10 @@ include:
6161
publishing, the only platform that does not support `authenticate` is web,
6262
where `google_sign_in_web`'s `renderButton` is used to create a sign-in
6363
button.
64+
* Outcomes other than successful authentication or authorization will throw
65+
`GoogleSignInException`s in most cases, allowing a clear way to distinguish
66+
different sign in failure outcomes. This includes the user canceling
67+
sign-in, which will throw an exception with a `code` of
68+
`GoogleSignInExceptionCode.canceled`.
69+
* Similarly, the `authenticationEvents` will receive exceptions as
70+
stream errors, unlike the event stream from version 6.x.

packages/google_sign_in/google_sign_in/lib/google_sign_in.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,16 @@ class GoogleSignIn {
233233

234234
/// Returns the single [GoogleSignIn] instance.
235235
///
236-
/// [initialize] must be called on this instance, and its future allowed to
237-
/// complete, before any other methods on the object are called.
236+
/// [initialize] must be called on this instance exactly once, and its future
237+
/// allowed to complete, before any other methods on the object are called.
238238
static final GoogleSignIn instance = GoogleSignIn._();
239239

240240
/// Initializes the sign in manager with the given configuration.
241241
///
242242
/// Clients must call this method exactly once, and wait for its future to
243-
/// complete, before calling any other methods on this object.
243+
/// complete, before calling any other methods on this object. Calling other
244+
/// methods without waiting for this method to return, or calling this method
245+
/// more than once, will result in undefined behavior.
244246
///
245247
/// [clientId] is the identifier for your client application, as provided by
246248
/// the Google Sign In server configuration, if any. This does not need to be

packages/google_sign_in/google_sign_in/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Flutter plugin for Google Sign-In, a secure authentication system
33
for signing in with a Google account.
44
repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in
55
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22
6-
version: 7.1.0
6+
version: 7.1.1
77

88
environment:
99
sdk: ^3.6.0

0 commit comments

Comments
 (0)