Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FireBase Login 시 Remote Fetch 작동하지 않는 오류 #40

Open
Dylan-yoon opened this issue May 22, 2023 · 1 comment
Open

FireBase Login 시 Remote Fetch 작동하지 않는 오류 #40

Dylan-yoon opened this issue May 22, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Dylan-yoon
Copy link
Member

FireBase에 데이터를 올리고 로그아웃 후 다시 재로그인 하는 과정에서 데이터를 가져오지 못하는 issues

@Dylan-yoon Dylan-yoon added the bug Something isn't working label May 22, 2023
@Dylan-yoon Dylan-yoon self-assigned this May 22, 2023
@Dylan-yoon
Copy link
Member Author

func kakaoLogin(completion: @escaping () -> Void,
                updateUserProfileCompletion: @escaping () -> Void,
                updateDataCompletion: @escaping () -> Void) {
    kakaoLoginManager.checkLoginEnabledAndLogin { [weak self] result in
        switch result {
        case .success(let user):
            guard let userEmail = user.kakaoAccount?.email,
                  let userID = user.id?.description,
                  let userName = user.properties,
                  let userNickName = userName["nickname"] else { return }
                
            self?.firebaseManager.signInWithEmail(email: userEmail, password: userID) { [weak self] gifts in
                print(gifts)
                self?.firebaseManager.changeProfile(name: userNickName, completion: updateUserProfileCompletion)
                
                do {
                    try self?.coreDataManager.updateAllData(gifts, completion: updateDataCompletion)
                    
                } catch {
                    print(error.localizedDescription)
                }
            }
            
            completion()
        case .failure(let error):
            print(error.localizedDescription)
        }
    }
}

함수 내부에서

 self?.firebaseManager.signInWithEmail(email: userEmail, password: userID) { [weak self] gifts in
                    print(gifts)
                    self?.firebaseManager.changeProfile(name: userNickName, completion: updateUserProfileCompletion)
                    
                    do {
                        try self?.coreDataManager.updateAllData(gifts, completion: updateDataCompletion)
                        
                    } catch {
                        print(error.localizedDescription)
                    }
                }

가 실행되지 않는것 확인

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant