crossplatformkorea / react-native-kakao-login

react-native native module for Kakao sign in.
MIT License
352 stars 134 forks source link

expo [Unhandled promise rejection: ReferenceError: Can't find variable: login] #258

Closed jimanjang closed 1 year ago

jimanjang commented 2 years ago

Version of kakao-login libraries 3.3.2

Version of react-native 0.64.2

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

Expected behavior Actual behavior 안녕하세요. expo 환경에서 카카오 로그인 구현 중 다음과 같은 이슈가 발생하여 질문 드리고자 합니다. [Unhandled promise rejection: ReferenceError: Can't find variable: login] 실제 네이티브 모듈이 연결이 안된것으로 생각드는데 명확하지 않아서 여쭤봅니다.

Tested environment (Emulator? Real Device?) Real Device

jimanjang commented 2 years ago

[Unhandled promise rejection: TypeError: null is not an object (evaluating 'RNKakaoLogins.login')] 수정하다 보니 위와같은 오류가 나옵니다. 제가 안드로이드만 설정하고 ios는 설정하지 않았는데 그런 사항 또한 이유가 되는걸까요?

100milliongold commented 2 years ago

https://github.com/react-native-seoul/react-native-kakao-login/issues/234

reject 을 해서 해야 하내요

jimanjang commented 2 years ago

expo eject 말씀하시는 걸까요? 그 부분으로 진행하였는데 위와 같이 오류가 나옵니다 ㅠ.

mununki commented 2 years ago

사용하신 코드를 올려주실 수 있나요? 저는 v2.x를 아래처럼 사용했었는데요. v3으로 올리고 나니 ... property of undefined 에러가 발생했습니다.

import KakaoLogins from "@react-native-seoul/kakao-login"

const result = await KakaoLogins.login()

이렇게 수정하였습니다.

import {login} from "@react-native-seoul/kakao-login"

const result = await login()

혹은

import * as KakaoLogins from "@react-native-seoul/kakao-login"

const result = await KakaoLogins.login()