@react-native-kakao/channel
Version:
React Native Kakao Channel SDK
49 lines • 1.64 kB
JavaScript
import { NativeModules, Platform } from 'react-native';
const LINKING_ERROR = "The package '@react-native-kakao/channel' doesn't seem to be linked. Make sure: \n\n" + Platform.select({
ios: "- You have run 'pod install'\n",
default: ''
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
const isTurboModuleEnabled = global.__turboModuleProxy != null;
const Module = isTurboModuleEnabled ? require('./spec/NativeKakaoChannel').default : NativeModules.RNCKakaoChannel;
const Native = Module ? Module : new Proxy({}, {
get() {
throw new Error(LINKING_ERROR);
}
});
export function followChannel(channelPublicId) {
return Native.followChannel(channelPublicId);
}
export function addChannel(channelPublicId) {
return Native.addChannel(channelPublicId);
}
export function getAddChannelUrl(channelPublicId) {
return Native.getAddChannelUrl(channelPublicId);
}
export function openAddChannelUrl(channelPublicId) {
return Native.openAddChannelUrl(channelPublicId);
}
export function chatChannel(channelPublicId) {
return Native.chatChannel(channelPublicId);
}
export function getChatChannelUrl(channelPublicId) {
return Native.getChatChannelUrl(channelPublicId);
}
export function openChatChannelUrl(channelPublicId) {
return Native.openChatChannelUrl(channelPublicId);
}
export function channels({
channelPublicIds = []
} = {}) {
return Native.channels(channelPublicIds);
}
const KakaoChannel = {
followChannel,
addChannel,
getAddChannelUrl,
openAddChannelUrl,
chatChannel,
getChatChannelUrl,
openChatChannelUrl,
channels
};
//# sourceMappingURL=index.js.map