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

getPrifle / getAccessToken시 앱이 꺼져버리는데 이유가있을까요 ?? #18

Open
stillgood96 opened this issue Apr 19, 2022 · 3 comments

Comments

@stillgood96
Copy link

stillgood96 commented Apr 19, 2022

`

    const kakaoLogin = async () => {
        try {
            await KakaoSDK.init("")
            const tokens = await KakaoSDK.login();
            console.log("토큰 시작")
            console.log(tokens);
            
            const profile = await KakaoSDK.getProfile();
            console.log(profile);
            
            if(tokens.access_token) {
                return setSns({
                    type : "kakao",
                    token : tokens.access_token
                });
            }

        } catch (e) {
            console.log("카카오에러 ");
            console.log(e);
        }
    }`

해당코드로 확인하면 토큰발급은 확인되는데 getProfile에서 앱이 꺼져버리는데 혹시 이유를 알 수 있을까요??

@ChanghyeonYoon
Copy link
Contributor

getProfile 로직 부분 소스를 올려주세요. 또한 app Key는 가려서 올리는게 좋으실 것 같습니다. @stillgood96

@stillgood96
Copy link
Author

stillgood96 commented Apr 19, 2022

앗 넵 수정했습니다. getProfile 로직 부분 소스라면 어디를 말씀해주시는걸까요 ??
readme 파일을 보고 진행했던거라서요..! @ChanghyeonYoon
image

@ChanghyeonYoon
Copy link
Contributor

ChanghyeonYoon commented Apr 19, 2022

KakaoSDK.init()을 kakaoLogin함수에서 처리해서 발생하는 에러로 추정됩니다.

const init = async () => await KakaoSDK.init(APP_KEY)
React.useEffect(() => {
init()
},[])

등으로 init을 먼저 진행하고 getProfile()이나 login() 을 호출해주세요.
@stillgood96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants