- Today
- Total
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- graphql
- 주식차트
- typeorm
- Flutter
- javascript
- 코인
- 비전공자
- chart
- Redux
- nextjs
- API
- 차트만들기
- 차트구현
- Firebase
- apollo
- 3주차
- Coin
- 항해99
- 채팅
- error
- 에러
- 차트
- nestjs
- websocket
- rtk
- 리액트
- 코인차트
- react
- 주식
- typescript
Act99 기술블로그
[비전공자] Flutter + Firebase | google_sign_in issue: PlatformException(sign_in_required, com.google.android.gms.common.api.ApiException: 4: 4: , null)) 에러가 날 경우 본문
[비전공자] Flutter + Firebase | google_sign_in issue: PlatformException(sign_in_required, com.google.android.gms.common.api.ApiException: 4: 4: , null)) 에러가 날 경우
Act99 2020. 11. 19. 20:56Flutter와 Firebase Auth 를 연동시키다보면 가끔
google_sign_in issue: PlatformException(sign_in_required, com.google.android.gms.common.api.ApiException: 4: 4: , null))
에러가 뜬다. 가령,
필자의 경우
@override
void initState() {
super.initState();
// Detects when user signed in
googleSignIn.onCurrentUserChanged.listen((account) {
handleSignIn(account);
}, onError: (err) {
print('Error signing in: $err');
});
googleSignIn.signInSilently(suppressErrors: false).then((account) {
handleSignIn(account);
}).catchError((err) {
print('Error signing in: $err');
});
}
여기서 googleSignIn.signInSilently() 쪽에서 에러가 생겼다.
- 해결방법 -
--------------------------------- 이 코드를
googleSignIn.signInSilently(suppressErrors: false).then((account) {
handleSignIn(account);
}).catchError((err) {
print('Error signing in: $err');
});
---------------------------------
googleSignIn.isSignedIn().then((isSignedIn) async {
if (isSignedIn)
await {
googleSignIn.signInSilently().then((account) => handleSignIn(account))
};
});
이렇게 대체하면 된다. (async / await은 생략 가능)