React Native example app using Formant's data-sdk
- Ensure you have NodeJS installed and then
npm i
- Sign up for Expo EAS and set up your environment
- To execute the app on an iOS simulator,
eas build -p ios --profile development
- You should only have to build this once unless you are modifying native modules, expo config, etc
- In the future, you can select the build you want to run via
eas build:run -p ios
npx expo start --dev-client
- This is the command you will normally run to develop once your environment is all set
- You can tap "i" to (re)launch the iOS simulator
- Set the
LAN_MODE
const based on if you want to make a direct IP connection to an agent vs routing through the Formant cloud- If you are using
LAN_MODE
, your agent must be at least version1.132.40
or higher- You must also set
export FORMANT_AGENT_IP=0.0.0.0
(or the device's private IP accessible to the client) in /var/lib/formant/.bashrc
- You must also set
- If you are not connecting locally, make sure to copy
auth.example.json.txt
toauth.json.txt
and fill in your login- This file is explicitly ignored in the gitignore
- If you are using
- Update the
DEFAULT_AGENT_ENDPOINT
const to reflect your device's name or IP address. Port 5502 is the default JOYSTICK_STREAM_NAME
is the topic/stream that the joystick data will be sent toVIDEO_ASPECT_RATIO
can be modified to match your teleop video aspect ratio to properly size the video player
You should only need to do this if @formant/ui-sdk-realtime-player
or its dependencies are updated
cd
intotelep-peer-rn
andnpm i
npm run build
- Copy the contents of dist/assets/{HASH}.js into player.txt located in the Expo assets folder