Page Content
React Native with the Web SDK
In order to use the Phenix Web SDK with React Native, first shim WebRTC via react-native-webrtc and then shim the Web SDK.
We support only Pure React Native apps. Expo will not work.
For a full example, see our Example
Shim the webrtc globals
JavaScript
1import {2 RTCPeerConnection,3 RTCIceCandidate,4 RTCSessionDescription,5 RTCView,6 MediaStream,7 MediaStreamTrack,8 getUserMedia,9} from 'react-native-webrtc';1011global = Object.assign(global, {12 RTCPeerConnection,13 RTCIceCandidate,14 RTCSessionDescription,15 RTCView,16 MediaStream,17 MediaStreamTrack,18 getUserMedia,19});
After that you need to include the Web SDK and shim the environment
JavaScript
1import sdk from 'phenix-web-sdk/dist/phenix-web-sdk-react-native.min';23sdk.util.RTC.shim();4// use sdk
v2023-01-31T21:25:10