iOSWebView

class : MonoBehaviour, IWebView

The iOS IWebView implementation, which includes static methods for iOS-specific functionality.

Summary

Public methods

AllowCustomUriSchemes

static void AllowCustomUriSchemes(bool allowCustomSchemes)

By default, iOSWebView blocks requests for custom schemes (ex: myapp://myaction?data=foo) in order to prevent sites like Wikipedia and YouTube from using URIs with custom schemes to launch their native apps via a webpage. However, if you want to override this behavior (for example, to use your own custom URI scheme within your app), you can enable custom URI schemes with this method. When a custom URI scheme is loaded (probably via JavaScript), the webview emits a UrlChanged event with the custom URL.

GetFileUrlForBundleResource

static string GetFileUrlForBundleResource(string fileName)

Returns a file URL for resource included in the iOS app bundle. This is useful for getting a file URL to a local file so that it can be loaded via IWebView.LoadUrl().

Example:

var fileUrl = iOSWebView.GetFileUrlForBundleResource("my-static-files/my-webpage.html");