WebView

Show a web browser in your game

Reference the library

C#
using CI.WSANative.Web;

Create the web view

You must have the internet client capability enabled in the app manifest, otherwise the WebView will not appear

C#
WSANativeWebView.Create(new WSAWebViewSettings() { HorizontalPlacement = WSAHorizontalPlacement.Centre, VerticalPlacement = WSAVerticalPlacement.Centre, Height = 700, Width = 700, Uri = new Uri("https://google.co.uk") });

Destroy the web view

C#
WSANativeWebView.Destroy();
C#
WSANativeWebView.Navigate(new Uri("http://www.claytoninds.com"));

Invoke a script

Run custom scripts or ones that are loaded on the current page. More detailed documentation is available here

C#
WSANativeWebView.InvokeScript("scriptName", arguments, result => { });

Events

Listen to these events for info about the webviews lifecycle

C#
WSANativeWebView.NavigationStarting
C#
WSANativeWebView.NavigationCompleted
C#
WSANativeWebView.UnviewableContentIdentified
C#
WSANativeWebView.DOMContentLoaded