-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Feature] #8 - 애플로그인 구현 #12
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.
잘보고가여~!
func setUI() { | ||
nameLabel.text = "name" | ||
emailLabel.text = "email" | ||
|
||
appleLoginButton.addTarget(self, action: #selector(handleAuthorizationAppleIDButtonPress), for: .touchUpInside) | ||
} |
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.
앗 저도 다음 이슈부터는 setUI 쓰겠읍니다... 그런데 일반적으로 애드타겟도 여기에 넣어주면 될까요??
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.
지금은 aggTarget이 하나밖에 없어서 그냥 setUI에 넣었는데,
보통은 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.
맞아여 이거 코드 컨밴션에 setupaddtarget 이었나 이었던거 같네여
UserDefaults.standard.set(username, forKey: "setFullName") | ||
UserDefaults.standard.set(email, forKey: "setEmail") |
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.
저희 프로젝트에서도 userDefaults 사용할때 키 파라미터값을 문자열로 사용하지 말구 Constants 폴더 세팅처럼 사용하면 좋을거 같아여
요건 첨 사용하는 사람이 ㅋㅋㅋ 만들어보는걸로 하져
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.
@yangsubinn @L-j-h-c
userDefaults 키 네임 컨밴션도 정해야 할거 같아요 키값이니까 set 보다는 appleFullName appleEmail 이렇게 설정하는건 어떨까요??
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.
저희 프로젝트에서도 userDefaults 사용할때 키 파라미터값을 문자열로 사용하지 말구 Constants 폴더 세팅처럼 사용하면 좋을거 같아여
요건 첨 사용하는 사람이 ㅋㅋㅋ 만들어보는걸로 하져
넴 알겠슴당... 오류나지 않도록 상수로 만들어놓기...
let authorizationController = ASAuthorizationController(authorizationRequests: [request]) | ||
authorizationController.delegate = self | ||
authorizationController.presentationContextProvider = self | ||
authorizationController.performRequests() |
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.
authorizationController라는 컨트롤러가 있다는게 카카오로그인이랑 다른 부분인 것 같아요!
카카오로그인에서는 싱글턴 객체를 이용했습니다....
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.
@L-j-h-c 오와..... 록시보이... 얼른 아이폰으로 애플로그인까지 뿌셔주세요....
Merge branch 'develop' of https://github.com/TeamSparker/Spark-Practice-iOS into feature/#8
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.
LZTM 😎
use_frameworks! | ||
|
||
# Pods for socialLogin | ||
pod 'SnapKit', '~> 5.0.0' |
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.
코베 줌보 선배가 간다 길을 비켜라.
// Apple ID Credential revoked, handle unlink | ||
// 로그아웃된 상태 -> 로그인뷰 | ||
print("해당 ID는 연동되어 있지 않습니다.") |
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.
정확히는 애플 소셜 로그인에는 로그아웃이 없어여! 카카오에 해당하는 연결끊기가 되겠네여
그래서 앱에서 로그아웃을 구현할 때는 서버로 부터 받은 토큰을 삭제하고
앱을 실행해서 자동로그인 로직의 시작을 서버로 부터 받은 토큰이 있냐? 없으면 로그인화면으로 보내고 있다면 카카오의 경우는 유효한지 애플의 경우 역시 연동이 되어있는지 에 대해서 가져갈 예정입니다!
view.addSubview(appleLoginButton) | ||
view.addSubview(nameLabel) | ||
view.addSubview(emailLabel) |
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.
나중에는 extension 으로 빼서 배열을 파라미터로 받아서 추가하는 코드를 추가해보죵!
원래 하시던 대로 하시면 됩니다 😁
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.
실제 스파크 프로젝트에서는 그 부분 따로 빼서 넣어볼게여!
UserDefaults.standard.set(username, forKey: "setFullName") | ||
UserDefaults.standard.set(email, forKey: "setEmail") |
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.
@yangsubinn @L-j-h-c
userDefaults 키 네임 컨밴션도 정해야 할거 같아요 키값이니까 set 보다는 appleFullName appleEmail 이렇게 설정하는건 어떨까요??
} | ||
|
||
print("useridentifier: \(userIdentifier)") | ||
UserDefaults.standard.set(userIdentifier, forKey: "setUserIdentifier") |
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.
이번에는 userDefaults 가 아닌 키체인에 넣어보는 챌린지는 어떨까요!
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.
오.. 좋아여! 보안상 중요한 친구니까 keychain이 더 맞을 것 같네요...
지금 하는 이슈 마무리하고 조금 수정해보겠슴니다~!
🌴 PR 요약
🌱 작업한 브랜치
🌱 작업한 내용
📌 참고 사항
최초 로그인시에만 받아오는 fullName과 email은 UserDefault에 저장해서
이후 로그인할 때는 UserDefault에 저장된 정보들을 가져오도록 했습니다
📸 스크린샷
📮 관련 이슈