WebView [Deprecated]

WebView is a component of the WebViewCanvas prefab that is part of the Ready Player Me 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.

Ready Player Me 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.

public void CreateWebview()

The Ready Player Me 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.

Properties

Property
Type
Description

KeepSessionAlive

bool

If set to false, clears stored avatar data after the avatar creation is finished or when the WebView is destroyed.

By default, this is set to true.

Public Methods

Method
Returns
Description

CreateWebview()

void

Creates the WebView window and loads the Ready Player Me website.

SetScreenPadding( int left, int top, int right, int bottom)

void

Sets the screen padding of the WebView window. Default is 0 for all sides.

SetVisible(bool visible)

void

Sets the visibility of the WebView.

ClearAvatarData()**

void

Clears avatar data from the WebView local storage and reloads the Ready Player Me page for new avatar creation.

async Task IsWebViewUpToDate()

bool

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.

If the cache is cleared, then the next time you open Ready Player Me in the WebView, your previous avatar will not be there, and you will start from the beginning of the avatar creation process.

Action

Event
EventArgs
Description

OnAvatarCreated

<string>

Event to call when an avatar is created. Receives GLB URL.

Example

Once you have imported the Ready Player Me SDK, find an example at Plugins > Ready Player Me > Examples > Webview Example.

Last updated

#168: React Guides

Change request updated