> For the complete documentation index, see [llms.txt](https://enoch-app.gitbook.io/enoch/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://enoch-app.gitbook.io/enoch/api-references/unity-sdk/webview.md).

# WebView

**WebView** is a component of the **WebViewCanvas** prefab that is part of the Enoch avatar SDK. To use a WebView, create a WebViewCanvas game object by selecting \
**GameObject > UI > WebView Canvas**.

`public async Task IsWebViewUpToDate()`

* Check if the WebView that will be used for displaying the RPM website is up to date for handling 3D graphics. If it returns false, it is not advised to load WebView since the browser performance will be poor. Instead, you can warn the user for them to update their system WebView applications.

{% hint style="info" %}
Enoch avatar website will work on Android devices with System WebView with a rendering engine equal to or newer than Chrome v70 or Firefox v64, and IOS devices with Webkit WebView equal to or newer than v600. This info is checked using the userAgent string of the WebView.
{% endhint %}

`public void CreateWebview()`

{% hint style="info" %}
The Enoch Avatar website will work on Android devices with System WebView with a rendering engine equal to or newer than Chrome v70 or Firefox v64, and IOS devices with Webkit WebView equal to or newer than v600. \
This info is checked using the userAgent string of the WebView.
{% endhint %}

## Properties

<table><thead><tr><th width="194">Property</th><th width="84.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>KeepSessionAlive</td><td>bool</td><td><p>If set to false, clears stored avatar data after the avatar creation is finished or when the WebView is destroyed. </p><p>By default, this is set to true.</p></td></tr></tbody></table>

## Public Methods

<table><thead><tr><th width="312">Method</th><th width="99.33333333333331">Returns</th><th>Description</th></tr></thead><tbody><tr><td><code>CreateWebview()</code></td><td>void</td><td>Creates the WebView window and loads the Enoch avatar website.</td></tr><tr><td><code>SetScreenPadding(</code><br>  <code>int left, int top,</code><br>  <code>int right,</code><br>  <code>int bottom)</code></td><td>void</td><td>Sets the screen padding of the WebView window. <br>Default is 0 for all sides.</td></tr><tr><td><code>SetVisible(bool visible)</code></td><td>void</td><td>Sets the visibility of the WebView. </td></tr><tr><td><code>ClearAvatarData()**</code></td><td>void</td><td>Clears avatar data from the WebView local storage and reloads the Enoch avatar page for new avatar creation.</td></tr><tr><td><code>async Task IsWebViewUpToDate()</code></td><td>bool</td><td>Checks if the WebView that will be used for displaying the RPM website is up to date for handling 3D graphics. If it returns false, it is not advised to load WebView since the browser performance will be poor. Instead, you can warn the user for them to update their system WebView applications.</td></tr></tbody></table>

{% hint style="info" %}
If the cache is cleared, then the next time you open Enoch avatar in the WebView, your previous avatar will not be there, and you will start from the beginning of the avatar creation process.
{% endhint %}

## Action

| Event           | EventArgs | Description                                                |
| --------------- | --------- | ---------------------------------------------------------- |
| OnAvatarCreated | \<string> | Event to call when an avatar is created. Receives GLB URL. |

## Example

Once you have imported the Enoch avatar SDK, find an example at \
**Plugins >** Enoch avatar **> Examples > Webview Example**.
