< /code>
my setup < /strong> < /p>
Версия Flutter: 3.32.8
Google_sign_in Пакет: ^6.1.6
Platform: Android
Target: Google Calendar и базовый доход профиля < /p>
o />
Мой запрос OAuth включает в себя следующие параметры: < /p>
login_hint=ak**********@gmail.com
hl=en-IN
response_type=consent_proof
android_options=CAMQAQ
color_scheme=dark
client_id=*200-m552****************n15f59*p7****kr*u.apps.googleusercontent.com
include_granted_scopes=true
scope=https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/keep openid https://www.googleapis.com/auth/userinfo.profile
flowName=GeneralOAuthFlow
< /code>
Google Cloud Console Configuration < /strong>
реализация кода
import 'package:google_sign_in/google_sign_in.dart';
class GoogleSignInService {
static final GoogleSignIn _googleSignIn = GoogleSignIn(
scopes: [
'email',
'profile',
'openid',
'https://www.googleapis.com/auth/calendar',
'https://www.googleapis.com/auth/keep',
],
);
static Future signIn() async {
try {
final GoogleSignInAccount? account = await _googleSignIn.signIn();
return account;
} catch (error) {
print('Google Sign-In Error: $error');
return null;
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... or-invalid