crossplatformkorea / react-native-kakao-login

react-native native module for Kakao sign in.
MIT License
350 stars 133 forks source link

ios에서 userprofile이 null로 들어오는 현상 #199

Open jihyeonjeong11 opened 3 years ago

jihyeonjeong11 commented 3 years ago

Version of kakao-login libraries

3.03

Version of react-native

0.63.4

Platforms you faced the error (IOS or Android or both?)

ios

Expected behavior

login() 이후 getProfile()을 통해 사용자가 동의했다면 선택 수집 항목들을 제대로 가져옴

Actual behavior

데이터 값이 null로 들어옴

Tested environment (Emulator? Real Device?)

에뮬레이터, 실제 기기 모두(iphone12)에서 테스트함

react-native-kakao-logins 업그레이드 이후, ios에서 getProfile()을 통해 요청한 정보들이 Null값으로 전송됩니다.

resolve([
                        "id": user?.id as Any,
                        "email": user?.kakaoAccount?.email as Any,
                        "nickname": user?.kakaoAccount?.profile?.nickname as Any,
                        "profileImageUrl": user?.kakaoAccount?.profile?.profileImageUrl as Any,
                        "thumbnailImageUrl": user?.kakaoAccount?.profile?.thumbnailImageUrl as Any,
                        "phoneNumber": user?.kakaoAccount?.phoneNumber as Any,
                        "ageRange": user?.kakaoAccount?.ageRange as Any,
                        "birthday": user?.kakaoAccount?.birthday as Any,
                        "birthdayType": user?.kakaoAccount?.birthdayType as Any,
                        "birthyear": user?.kakaoAccount?.birthyear as Any,
                        "gender": user?.kakaoAccount?.gender as Any,
                        "isEmailValid": user?.kakaoAccount?.isEmailValid as Any,
                        "isEmailVerified": user?.kakaoAccount?.isEmailVerified as Any,
                        "isKorean": user?.kakaoAccount?.isKorean as Any,
                        "ageRangeNeedsAgreement": user?.kakaoAccount?.ageRangeNeedsAgreement as Any,
                        "birthdayNeedsAgreement": user?.kakaoAccount?.birthdayNeedsAgreement as Any,
                        "birthyearNeedsAgreement": user?.kakaoAccount?.birthyearNeedsAgreement as Any,
                        "emailNeedsAgreement": user?.kakaoAccount?.emailNeedsAgreement as Any,
                        "genderNeedsAgreement": user?.kakaoAccount?.genderNeedsAgreement as Any,
                        "isKoreanNeedsAgreement": user?.kakaoAccount?.isKoreanNeedsAgreement as Any,
                        "phoneNumberNeedsAgreement": user?.kakaoAccount?.phoneNumberNeedsAgreement as Any,
                        "profileNeedsAgreement": user?.kakaoAccount?.profileNeedsAgreement as Any,
                    ])

확인 결과 , RNKakaoLogins.swift의 이 부분에서 들어오는 user?.kakaoAccount?.ageRange 와 같은 Optional값들이 제대로 resolve가 되지 않은 것으로 추정이 됩니다. 실제 성별을 xcode 콘솔로 확인하니 이러한 Optional값이 관측이 되었는데,

Optional(KakaoSDKUser.Gender.Male)

이 부분을 JS react-native에서 확인을 하니 null이었습니다.

유용한 패키지 감사합니다.

jihyeonjeong11 commented 3 years ago

저 위의 코드에서

user?.kakaoAccount?.gender.rawValue

.rawValue 를 추가하니 정상적으로 갑이 js단에서 표시됩니다. 제가 ios 개발자가 아니라서 수정사항에 대해 어떤 에러가 발생할지는 정확히 몰라서 이부분도 문의드리고 싶습니다!

hyochan commented 3 years ago

저 위의 코드에서

user?.kakaoAccount?.gender.rawValue

.rawValue 를 추가하니 정상적으로 갑이 js단에서 표시됩니다. 제가 ios 개발자가 아니라서 수정사항에 대해 어떤 에러가 발생할지는 정확히 몰라서 이부분도 문의드리고 싶습니다!

좋은 PR로 보여집니다. 혹시 보내주실 수 있으실까요?

JeffGuKang commented 3 years ago

현재 예제에서는 정상동작되는 것으로 보입니다. @jihyeonjeong11 혹시 라이브러리에 첨부된 예제는 정상 동작하시나요?