728x90
플루터하면 항상 소셜로그인이 들어가는데,
많은 소셜로그인이 있지만 제일 힘든건 애플...
애플은 ios랑 android를 따로 해주어야되는데, 애플이 자기꺼라고 ios만 편애하는거같다
https://pub.dev/packages/sign_in_with_apple
공식 사이트에 설명이 잘 되어있지만, 모두 ios기준이다
ios는 하라는대로하면 문제없이 잘 되지만 android는 이렇게 하면 아래와 같은 오류가 발생한다
그래서 안드로이드 코드만 작성해보려구한다
String redirectURL = dotenv.env['APPLE_REDIRECT_URI'].toString();
print(redirectURL);
String? clientID = dotenv.env['APPLE_CLIENT_ID'];
final appleIdCredential = await SignInWithApple.getAppleIDCredential(
scopes: [
AppleIDAuthorizationScopes.email,
AppleIDAuthorizationScopes.fullName,
],
webAuthenticationOptions: WebAuthenticationOptions(
clientId: clientID!,
redirectUri: Uri.parse(redirectURL),
));
print(appleIdCredential.authorizationCode);
this.socialLogin(appleIdCredential.authorizationCode, "apple");
안드로이드는 백엔드 서버의 콜백이 무조건 필요한 구조인데, 코드에서, 콜백을 지정해줘야된다는것!
다음엔 해메지않고 바로 해결할 수 있기를 🙏🏻
참고
https://stackoverflow.com/questions/62805312/android-sign-in-with-apple-and-firebase-flutter
728x90
'FRAMEWORK > FLUTTER' 카테고리의 다른 글
flutter datetime format (1) | 2022.02.22 |
---|---|
플루터 bar chart에서 가로 스크롤 추가하기 (0) | 2022.01.10 |
Flutter 사파리 왼쪽에서 오른쪽으로 스와이프 뒤로가기 트랜지션 오류 수정은 이렇게! (0) | 2022.01.03 |
[Flutter] web cors 오류 해결 (2) | 2021.11.25 |
flutter 웹 firebase 기본 셋팅 오류 정리 (0) | 2021.11.25 |