Вот код, который я написал
Код: Выделить всё
Future signInWithApple(SignInMethod flow, {LoginMethod? loginMethod}) async {
this.loginMethod = loginMethod ?? authProvider.state.loginMethod;
if (kDebugMode) {
print('loginMethod: ${this.loginMethod}');
}
showLoader();
try {
// Configure webAuthenticationOptions for Android
final authOptions = WebAuthenticationOptions(
clientId: 'com.dev.applesignin', // Replace with your client ID
redirectUri: Uri.parse('https://app.firebaseapp.com/__/auth/handler'),
// Replace with your redirect URI
);
// Start the sign-in flow
final appleCredential = await SignInWithApple.getAppleIDCredential(
scopes: [AppleIDAuthorizationScopes.email, AppleIDAuthorizationScopes.fullName],
webAuthenticationOptions: authOptions,
);
final oauthCredential = OAuthProvider('apple.com').credential(
idToken: appleCredential.identityToken,
accessToken: appleCredential.authorizationCode,
);
await signInToFirebase(
oauthCredential,
);
hideLoader();
} catch (e) {
hideLoader();
// Handle error
print("Error occurred during Apple authentication: $e");
}
}
D/SystemUtils(23579): [isSystemApp] Begin android.app.Application@74134b4
D/ScreenUtils(23579): isMultiWindow:0,userId:0
D/ScreenUtils(23579): hasVivoFreeformTasks:0,userId:0
D/ScreenUtils(23579): isLittleVExist:0,userId:0
D/SystemUtils(23579): userId:0
D/SystemUtils( 23579): [isSystemApp] начать android.app.Application@74134b4
D/ScreenUtils(23579): isMultiWindow:0,userId:0
D/ScreenUtils(23579): hasVivoFreeformTasks:0,userId:0
D/ScreenUtils(23579): isLittleVExist:0,userId:0
D/SystemUtils(23579): userId:0
[GoRouter] получает местоположение для имени: «createWallet»
[GoRouter] нажимает /createWallet< /p>
I/flutter (23579): необработанный элемент ; Ключ изображения: загрузчик Svg
D/SystemUtils(23579): [isSystemApp] Begin android.app.Application@74134b4
D/ScreenUtils(23579) ): isMultiWindow:0,userId:0
D/ScreenUtils(23579): hasVivoFreeformTasks:0,userId:0
D/ScreenUtils(23579) ): isLittleVExist:0,userId:0
D/SystemUtils(23579): userId:0
D/SystemUtils(23579): [isSystemApp ] начало android.app.Application@74134b4
D/ScreenUtils(23579): isMultiWindow:0,userId:0
D/ScreenUtils(23579) ): hasVivoFreeformTasks:0,userId:0
D/ScreenUtils(23579): isLittleVExist:0,userId:0
D/SystemUtils(23579) ): userId:0
D/SystemUtils(23579): [isSystemApp] начать android.app.Application@74134b4
D/ScreenUtils(23579 ): isMultiWindow:0,userId:0
D/ScreenUtils(23579): hasVivoFreeformTasks:0,userId:0
D/ScreenUtils(23579) ): isLittleVExist:0,userId:0
D/SystemUtils(23579): userId:0
I/flutter (23579): loginMethod: LoginMethod.signUp
D/SessionLifecycleClient(23579): отправка жизненного цикла 2 в службу
D/SessionLifecycleService(23579): фоновая активность по номеру 141606119
I/FA (23579): Приложение находится по адресу: timestamp_millis: 1719838599560
I/TRuntime.CctTransportBackend(23579): Делает запрос: https:/ /firebaselogging-pa.googleapis.com/v1/firelog/legacy/batchlog
D/TrafficStats(23579): tagSocket(233) с statsTag=0xffffffff, statsUid=-1
I/TRuntime.CctTransportBackend(23579): Код состояния: 200
Я попробовал очистить браузер по умолчанию и также разрешил использование стороннего браузера
Подробнее здесь: https://stackoverflow.com/questions/786 ... n-if-brows
Мобильная версия