React Native

Embedding TutAR 3D viewer in a React Native app

Prerequisites

The 3D viewer can be embedded into a React native app using a web view, here we are using react-native-webviewarrow-up-right as an example but it can be replaced with any web view library of your choice.

Getting User Permissions

In order to enable the AR functionality, Make sure to take camera permission from the user.

AndroidManifest.xml
<manifest>
<!--
rest of the code
-->
    <uses-feature android:name="android.hardware.camera" android:required="false" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.webkit.PermissionRequest" />
    <uses-permission android:name="android.permission.INTERNET" />

<manifest>

Here we use react-native-vision-cameraarrow-up-right to request camera access.

Embedding the Viewer

Render the webview component here all the below props are recommended but the mediaCapturePermissionGrantType & allowsInlineMediaPlayback is required for using the AR functionality.

Last updated