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

[FEAT] #167 - 애플 소셜 로그인 구현 #179

Merged
merged 6 commits into from
Dec 21, 2021

Conversation

mini-min
Copy link
Member

🌴 PR 요약

🌱 작업한 브랜치

🌱 작업한 내용

  • 애플 소셜 로그인 로직 추가
  • 애플 로그인 이미지 코드로 구현 -> 이 부분은 한글로 수정할 때, 이미지로 변경할지
  • userDefaults 저장값 (userID 추가 -> 이 부분 가져다 쓰세요 ^__^)
  • 기타: 메인뷰에 들어가는 명함생성&리스트 아이콘 수정

📮 관련 이슈

@mini-min mini-min added Minjae 🐻‍❄️ 민재 강남1타강사 작업 P1 / Priority High 우선순위 높음 Feat 새로운 기능 구현 labels Dec 21, 2021
@mini-min mini-min self-assigned this Dec 21, 2021
Copy link
Member

@hyun99999 hyun99999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로그인 두개나 붙이느라 고생하셨어여!

Comment on lines +34 to +40
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)
])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

카카오와 애플 모두 스택뷰로도 안해두 되구 이렇게 코드로도 안짜도 괜찮았을텐뎅 혹시 이유가 있나요??
코드베이스 선배로 갈아타시는건가요...! 도-약

Copy link
Member Author

@mini-min mini-min Dec 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 굳이 이렇게 안해도 되긴 하는데, 애플이랑 뭔가 맞춰주고 싶어서 스택뷰 써서 코드로 변경했습니다 ^__^
그래서 카카오도 addTarget 쓰는걸로 변경했구요..!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굳! 고생해써여~

Comment on lines +162 to +163
func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor {
return self.view.window!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

어떤 역할인가용?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 뷰에 띄우는 역할이군여... 굳굳!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 맞습니당 ^__^

Comment on lines +42 to +45
NotificationCenter.default.addObserver(forName: ASAuthorizationAppleIDProvider.credentialRevokedNotification, object: nil, queue: nil) { (Notification) in
print("Revoked Notification")
self.isLogin = false
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오...애플 아이디 해제하면 이렇게 되는군여 진짜 어떤 시나리오로 적용이 되는지 해봤나욤?
앱을 실행하고 해제하고 다시 앱으로 들어오면 아무렇지 않지만 재실행하면 로그인화면으로 가는거 같은데 맞나요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분은 스플래시 하면서 같이 수정하려고 일단 놔뒀습니다!

Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵!!

@mini-min mini-min merged commit fd34150 into TeamNADA:release1.0/1 Dec 21, 2021
@mini-min mini-min deleted the release/#167 branch December 21, 2021 06:41
Comment on lines +26 to +40
// 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
// }
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style share 가이드에서는 클로저의 매겨변수인경우는 앞뒤로 () 를 사용하지 않아서 저는 그걸 따르는 편이에요! 참고해주세요!
error 를 선언했다면 사용해주거나 _ 이렇게 하면 사용하지 않아도 워닝이 없답니다!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 알겠습니다 감사합니당 ^__^

@mini-min mini-min changed the title [FEAT] 애플 소셜 로그인 구현 [FEAT] #167 - 애플 소셜 로그인 구현 Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feat 새로운 기능 구현 Minjae 🐻‍❄️ 민재 강남1타강사 작업 P1 / Priority High 우선순위 높음
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 애플 로그인 구현
2 participants