Using React Native

If you’re using React Native, you can embed Whereby rooms with just a few simple steps as laid out in this guide.

Follow this guide to add and setup the react-native-webview library in your React Native project.

Finally, add the WebView component to your code, setup the properties and fill the room URL and parameters.

Here is a short example:

import React, { Component } from 'react';
import { WebView } from 'react-native-webview';

const roomUrl = ''; // Replace by your own
const roomParameters = '?needancestor&skipMediaPermissionPrompt';

export default class App extends Component {
  render() {
    return (
      <WebView
        startInLoadingState
        source={{ uri: roomUrl + roomParameters }}
        // If using html as source, you need to include baseUrl: "https://whereby.com" as a secondary prop
        mediaPlaybackRequiresUserAction={false}
        mediaCapturePermissionGrantType={'grant'}

        // iOS specific:
        allowsInlineMediaPlayback

        // Android specific:
        javaScriptEnabled
        domStorageEnabled
      />
    );
  }
}

Last updated

Was this helpful?