Thanks to visit codestin.com
Credit goes to github.com

Skip to content

shift72/rocket-expo

Repository files navigation

Rocket SDK Expo edition

This is a thin wrapper over the Shift72 rocket-sdk-android and rocket-sdk-ios native SDKs, easing use of them within Expo projects.

Get started

  1. Install dependencies
npm install git://github.com/shift72/rocket-expo.git
  1. Add the plugin to app.json
{
  "expo": {
    "plugins": [
      "rocket-expo"
    ]
  }
}
  1. Run a prebuild
npx expo prebuild --clean
  1. Run one-time initialisation somewhere in a root view
import RocketExpo from 'rocket-expo';

useEffect(() => {
  RocketExpo.setupHostname(hostname);
  RocketExpo.setupLogger();
},[]);
  1. 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
  }}
/>
  1. Compile and start the app

Android

npx expo run:android --device

iOS

npx expo run:ios --device

Notes