Page Content
React Native with the Web SDK
React Native support has been deprecated. Please see our FAQ entry for more information.
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
import {
RTCPeerConnection,
RTCIceCandidate,
RTCSessionDescription,
RTCView,
MediaStream,
MediaStreamTrack,
getUserMedia,
} from 'react-native-webrtc';
global = Object.assign(global, {
RTCPeerConnection,
RTCIceCandidate,
RTCSessionDescription,
RTCView,
MediaStream,
MediaStreamTrack,
getUserMedia,
});
After that you need to include the Web SDK and shim the environment
JavaScript
import sdk from 'phenix-web-sdk/dist/phenix-web-sdk-react-native.min';
sdk.util.RTC.shim();
// use sdk
v2023-12-04T20:36:01.000Z