@react-native-kakao/core
Version:
React Native Kakao Core SDK
31 lines • 1.69 kB
JavaScript
import { kAssert } from './util/kAssert';
import { kCreateWebError } from './util/kCreateWebError';
import { kFetch, kFetchFormUrlEncoded } from './util/kFetch';
import kGlobalStorage from './util/kGlobalStorage';
import { kRunWebAPI } from './util/kRunWebAPI';
const KakaoCore = {
getKeyHashAndroid: async () => {
return undefined;
},
initializeKakaoSDK: async (appKey, options) => {
var _options$web, _options$web2;
kAssert(options === null || options === void 0 || (_options$web = options.web) === null || _options$web === void 0 ? void 0 : _options$web.javascriptKey, '[initializeKakaoSDK] javascriptKey is missing');
kAssert(options === null || options === void 0 || (_options$web2 = options.web) === null || _options$web2 === void 0 ? void 0 : _options$web2.restApiKey, '[initializeKakaoSDK] restApiKey is missing');
await kRunWebAPI(() => {
var _options$web3, _options$web4;
kGlobalStorage.javascriptKey = options === null || options === void 0 || (_options$web3 = options.web) === null || _options$web3 === void 0 ? void 0 : _options$web3.javascriptKey;
kGlobalStorage.restApiKey = options === null || options === void 0 || (_options$web4 = options.web) === null || _options$web4 === void 0 ? void 0 : _options$web4.restApiKey;
if (!Kakao.isInitialized()) {
Kakao.init(options.web.javascriptKey);
}
kAssert(Kakao.isInitialized(), 'Kakao.isInitialized returns false');
});
}
};
export const {
getKeyHashAndroid,
initializeKakaoSDK
} = KakaoCore;
export default KakaoCore;
export { kAssert, kCreateWebError, kGlobalStorage, kFetch, kFetchFormUrlEncoded, kRunWebAPI };
//# sourceMappingURL=index.web.js.map