This is a thin wrapper over the Shift72 rocket-sdk-android and rocket-sdk-ios native SDKs, easing use of them within Expo projects.
- Install dependencies
npm install git://github.com/shift72/rocket-expo.git- Add the plugin to app.json
{
"expo": {
"plugins": [
"rocket-expo"
]
}
}- Run a prebuild
npx expo prebuild --clean- Run one-time initialisation somewhere in a root view
import RocketExpo from 'rocket-expo';
useEffect(() => {
RocketExpo.setupHostname(hostname);
RocketExpo.setupLogger();
},[]);- Add a RocketExpoView somewhere
import { RocketExpoView } from 'rocket-expo';
<RocketExpoView
playbackConfig={{slug: slug, token: token}}
onPlaybackCompleted={() => console.log("playback completed")}
style={{
width: '100%',
height: 400 //for example
}}
/>- Compile and start the app
npx expo run:android --devicenpx expo run:ios --device