Getting started
This page will help you get started with emBET SDK
Installation
The React Native emBET SDK can be installed with npm or yarn. For more details see the NPM Package (https://www.npmjs.com/package/@livelike/embet-rn-websdk)
npm i @livelike/embet-rn-websdk
During the installation process, you will see that embet-rn-websdk requires react-native-webview (version 11+) to be installed before using the SDK. react-native-webview can be installed with npm or yarn
npm i react-native-webview
To be able to link web-view as a native dependency, for iOS, If you are using CocoaPods, in the ios/ directory run:
pod install
For Android, please make sure AndroidX is enabled in your project by editing android/gradle.properties and adding 2 lines:
android.useAndroidX=true
android.enableJetifier=true
Basic Usage
First of all, you should import EmBETWebView from @livelike/embet-rn-websdk. The next step is to use the imported component.
The EmBetWebView can be instantiated with a clientId and one of the two optional properties: programId or customId. All the properties should have a string value.
import React from "react";
import { StyleSheet, View } from "react-native";
import { EmBETWebView } from "@livelike/embet-rn-websdk";
const AnyComponent = () => {
return (
<View style={styles.container}>
<EmBETWebView
clientId="clientId"
customId="customId" // OR customid="customId"
/>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1
},
});Now the emBET SDK is initialised and ready to show any published widget by the CMS in the provided program.
Updated 14 days ago
