Expo 환경에서,카카오 SDK 버전은 확인되는데 Api, Auth 등 모두 비어있습니다

“expo”: “~36.0.0”,
“react”: “~16.9.0”,
“react-native”: “https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz”,

안녕하세요. react native, expo 사용해서 native 코드 없이 개발중입니다.

카카오 SDK Javascript 버전을 이용해서 친구 목록 불러오기 기능을 개발하려고 하고 있습니다.

index.html 파일을 만들었고, WebView에서 참조하도록 했습니다.

Kakao.Auth 와 Kakao.Api 모두 작동하지 않아서 아래 코드를 이용해 디버깅을 했습니다. 맨 아래에 사용한 코드 전체를 첨부하겠습니다.

JSON.stringify(Kakao)

Javascript 앱 키를 사용하여 Kakao.init() 을 했을 떄와, 앱 키를 비워둔 채로 Kakao.init(’’) 을 했을 때 모두 결과가 다음과 같았습니다.

{
“VERSION”:“1.39.0”,
“Story”:{ },
“Auth”:{ },
“API”:{ },
“Link”:{ },
“Emoticon”:{ },
“Navi”:{ },
“PlusFriend”:{ },
“Channel”:{ },
“Wishlist”:{ }
}

domain 설정은 다음과 같았습니다.

http://localhost:8000
http://127.0.0.1:8000
http://127.0.0.1
http://127.0.0.1:19000
http://localhost:19000

아래는 index.html 파일과 그것을 참조하여 WebView를 만드는 WebViewExample.js 파일입니다.

index.html
head 내부는 다음과 같습니다.

 <meta charset="utf-8" />
 <title>Kakao SDK index</title>
 <script src="https://developers.kakao.com/sdk/js/kakao.min.js"></script>

body 내부는 다음과 같습니다.

 <div id="divId">Kakao SDK index page</div>
 <script type="text/javascript">
   Kakao.init("My App Key");
   alert(JSON.stringify(Kakao));
   alert(Kakao.isInitialized());
 </script>
 <div>Kakao SDK index page</div>

WebViewExample.js

import * as React from “react”;
import { WebView } from “react-native-webview”;

export default class WebViewSample extends React.Component {
render() {
const indexLocation = “…/kakao_sdk/index.html”;
return (
<WebView
nativeConfig={{ props: { webContentsDebuggingEnabled: true } }}
originWhitelist={["*"]}
source={require(indexLocation)}
style={{ flex: 1 }}
javaScriptEnabled={true}
allowFileAccess={true}
mixedContentMode=‘always’
/>
);
}
}

문제가 무엇일지, 해결 방법을 문의드립니다.

SDK가 정상적으로 초기화된 것으로 보입니다.(JSON.stringify 에서 함수는 변환되지 않으므로 위 결과가 정상입니다)
어떤 기능이 동작하지 않는걸까요?

JSON.stringify 로는 함수는 알기 어렵군요! 감사합니다.

Kakao.API.request({
url: “/v1/api/talk/friends”,
success: function (response) {
alert("friends: ");
alert(response);
},
fail: function (error) {
alert("error: ");
alert(error);
},
});

위와 같이 /api/talk/friends 기능을 사용하려고 했는데 , fail function 이 실행됩니다.

말씀주신 것으로는 내용을 파악하기 어렵습니다.
원인파악을 위해 발생한 에러 문구, 그리고 앱 ID를 알려주세요.

별다른 오류 메세지 없이 fail 함수가 실행됩니다. 앱 ID 는 433563 입니다.