You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Otherwise, you may encounter `APIException` errors.
27
-
28
-
### iOS integration
29
-
30
-
Please see [instructions on integrating Google Sign-In for iOS](https://pub.dev/packages/google_sign_in_ios#ios-integration).
31
-
32
-
#### iOS additional requirement
33
-
34
-
Note that according to
35
-
https://developer.apple.com/sign-in-with-apple/get-started, starting June 30,
36
-
2020, apps that use login services must also offer a "Sign in with Apple" option
37
-
when submitting to the Apple App Store.
38
-
39
-
Consider also using an Apple sign in plugin from pub.dev.
40
-
41
-
The Flutter Favorite
42
-
[sign_in_with_apple](https://pub.dev/packages/sign_in_with_apple) plugin could
43
-
be an option.
44
-
45
-
### macOS integration
46
-
47
-
Please see [instructions on integrating Google Sign-In for macOS](https://pub.dev/packages/google_sign_in_ios#macos-setup).
48
-
49
-
### Web integration
11
+
### Import the package
50
12
51
-
The new SDK used by the web has fully separated Authentication from Authorization,
52
-
so `signIn` and `signInSilently` no longer authorize OAuth `scopes`.
***Android**: Please see [the `google_sign_in_android` README](https://pub.dev/packages/google_sign_in_android#integration).
20
+
***iOS**: Please see [the `google_sign_in_ios` README](https://pub.dev/packages/google_sign_in_ios#ios-integration).
21
+
***macOS**: Please see [the`google_sign_in_ios` README](https://pub.dev/packages/google_sign_in_ios#macos-integration) (which also supports macOS).
22
+
***Web**: Please see [the `google_sign_in_web`README](https://pub.dev/packages/google_sign_in_web#integration).
/// This example always uses the stream-based approach to determining
42
+
/// which UI state to show, rather than using the future returned here,
43
+
/// if any, to conditionally skip directly to the signed-in state.
44
+
signIn.attemptLightweightAuthentication();
45
+
}));
85
46
```
86
47
87
-
[Full list of available scopes](https://developers.google.com/identity/protocols/googlescopes).
88
-
89
-
You can now use the `GoogleSignIn` class to authenticate in your Dart code, e.g.
48
+
If the user isn't signed in by the lightweight method, you can show UI to
49
+
start a sign-in flow. This uses `authenticate` on platforms that return true
50
+
for `supportsAuthenticate`, otherwise applications should fall back to a
51
+
platform-specific approach. For instance, user-initiated sign in on web must
52
+
use a button rendered by the sign in SDK, rather than application-provided
_(Only implemented in the web platform, from version 6.1.0 of this package)_
92
+
[Full list of available scopes](https://developers.google.com/identity/protocols/googlescopes).
136
93
137
94
### Requesting more scopes when needed
138
95
139
96
If an app determines that the user hasn't granted the scopes it requires, it
140
-
should initiate an Authorization request. (Remember that in the web platform,
141
-
this request **must be initiated from an user interaction**, like a button press).
97
+
should initiate an Authorization request. On platforms where
Server auth codes are not always available on all platforms. For instance, on
131
+
some platforms they may only be returned when a user initially signs in, and
132
+
not for subsequent authentications via the lightweight process. If you
133
+
need a server auth code you should request it as soon as possible after initial
134
+
sign-in, and manage server tokens for that user entirely on the server side
135
+
unless the signed in user changes.
180
136
181
-
If an app needs any scope other than `email`, `profile` and `openid`, it **must**
182
-
implement a more complete scope handling, as described above.
137
+
On platforms where `authorizationRequiresUserInteraction()` returns true,
138
+
this request **must be initiated from a user interaction** like a button press.
183
139
184
140
## Example
185
141
186
-
Find the example wiring in the
187
-
[Google sign-in example application](https://github.com/flutter/packages/blob/main/packages/google_sign_in/google_sign_in/example/lib/main.dart).
142
+
The
143
+
[Google Sign-In example application](https://github.com/flutter/packages/blob/main/packages/google_sign_in/google_sign_in/example/lib/main.dart) demonstrates one approach to using this
144
+
package to sign a user in and authorize access to specific user data.
145
+
146
+
## Migration from pre-7.0 versions
147
+
148
+
If you used version 6.x or earlier of `google_sign_in`, see
0 commit comments