-
Notifications
You must be signed in to change notification settings - Fork 5
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
[FEAT] #167 - 애플 소셜 로그인 구현 #179
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로그인 두개나 붙이느라 고생하셨어여!
kakaoButton.translatesAutoresizingMaskIntoConstraints = false | ||
NSLayoutConstraint.activate([ | ||
kakaoButton.topAnchor.constraint(equalTo: loginProviderStackView.topAnchor), | ||
kakaoButton.leadingAnchor.constraint(equalTo: loginProviderStackView.leadingAnchor), | ||
kakaoButton.trailingAnchor.constraint(equalTo: loginProviderStackView.trailingAnchor), | ||
kakaoButton.heightAnchor.constraint(equalToConstant: 48) | ||
]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
카카오와 애플 모두 스택뷰로도 안해두 되구 이렇게 코드로도 안짜도 괜찮았을텐뎅 혹시 이유가 있나요??
코드베이스 선배로 갈아타시는건가요...! 도-약
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 굳이 이렇게 안해도 되긴 하는데, 애플이랑 뭔가 맞춰주고 싶어서 스택뷰 써서 코드로 변경했습니다 ^__^
그래서 카카오도 addTarget
쓰는걸로 변경했구요..!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굳! 고생해써여~
func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor { | ||
return self.view.window! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어떤 역할인가용?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 뷰에 띄우는 역할이군여... 굳굳!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 맞습니당 ^__^
NotificationCenter.default.addObserver(forName: ASAuthorizationAppleIDProvider.credentialRevokedNotification, object: nil, queue: nil) { (Notification) in | ||
print("Revoked Notification") | ||
self.isLogin = false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오...애플 아이디 해제하면 이렇게 되는군여 진짜 어떤 시나리오로 적용이 되는지 해봤나욤?
앱을 실행하고 해제하고 다시 앱으로 들어오면 아무렇지 않지만 재실행하면 로그인화면으로 가는거 같은데 맞나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분은 스플래시 하면서 같이 수정하려고 일단 놔뒀습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 넵! 시나리오를 잘 세워서 하면 좋은 대응이 될거같아요
func postUserSignUpWithAPI(request: String) { | ||
UserAPI.shared.userSocialSignUp(request: request) { response in | ||
switch response { | ||
case .success(let loginData): | ||
print("postUserSignUpWithAPI - success") | ||
if let userData = loginData as? UserWithTokenRequest { | ||
UserDefaults.standard.set(userData.user.userID, forKey: Const.UserDefaults.userID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵!!
// appleIDProvider.getCredentialState(forUserID: Const.UserDefaults.userID) { (credentialState, error) in | ||
// switch credentialState { | ||
// case .authorized: | ||
// print("해당 ID는 연동되어있습니다.") | ||
// self.isLogin = true | ||
// case .revoked: | ||
// print("해당 ID는 연동되어있지않습니다.") | ||
// self.isLogin = false | ||
// case .notFound: | ||
// print("해당 ID를 찾을 수 없습니다.") | ||
// self.isLogin = false | ||
// default: | ||
// break | ||
// } | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style share 가이드에서는 클로저의 매겨변수인경우는 앞뒤로 () 를 사용하지 않아서 저는 그걸 따르는 편이에요! 참고해주세요!
error
를 선언했다면 사용해주거나 _ 이렇게 하면 사용하지 않아도 워닝이 없답니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 알겠습니다 감사합니당 ^__^
🌴 PR 요약
🌱 작업한 브랜치
🌱 작업한 내용
📮 관련 이슈