UniWebView
UniWebView Class Reference

The main class of UniWebView. More...

Inheritance diagram for UniWebView:

Public Member Functions

delegate void LoadCompleteDelegate (UniWebView webView, bool success, string errorMessage)
 
delegate void LoadBeginDelegate (UniWebView webView, string loadingUrl)
 
delegate void ReceivedMessageDelegate (UniWebView webView, UniWebViewMessage message)
 
delegate void EvalJavaScriptFinishedDelegate (UniWebView webView, string result)
 
delegate bool WebViewShouldCloseDelegate (UniWebView webView)
 
delegate void ReceivedKeyCodeDelegate (UniWebView webView, int keyCode)
 
delegate UniWebViewEdgeInsets InsetsForScreenOreitationDelegate (UniWebView webView, UniWebViewOrientation orientation)
 
void Load ()
 Load the url set in

See also
url

property of this UniWebView. More...

 
void Load (string aUrl)
 A alias method to load a specified url. More...
 
void LoadHTMLString (string htmlString, string baseUrl)
 Load a HTML string. More...
 
void Reload ()
 Reload current page. More...
 
void Stop ()
 Stop loading the current request. It will do nothing if the webpage is not loading. More...
 
void Show (bool fade=false, UniWebViewTransitionEdge direction=UniWebViewTransitionEdge.None, float duration=0.4f, Action finishAction=null)
 Show this UniWebView on screen. More...
 
void Hide (bool fade=false, UniWebViewTransitionEdge direction=UniWebViewTransitionEdge.None, float duration=0.4f, Action finishAction=null)
 Hide this UniWebView. More...
 
void EvaluatingJavaScript (string javaScript)
 Send a piece of javascript to the web page and evaluate (execute) it. More...
 
void AddJavaScript (string javaScript)
 Add some javascript to the web page. More...
 
void CleanCache ()
 Clean the cache of this UniWebView. More...
 
void CleanCookie (string key=null)
 Clean the cookie using in the app. More...
 
void SetTransparentBackground (bool transparent=true)
 Set the background of webview to transparent. More...
 
void SetBackgroundColor (Color color)
 Set the background color of webview. More...
 
void ShowToolBar (bool animate)
 Show the tool bar. The tool bar contains three buttons: go back, go forward and close webview. More...
 
void HideToolBar (bool animate)
 Hide the tool bar. The tool bar contains three buttons: go back, go forward and close webview. More...
 
void SetShowSpinnerWhenLoading (bool show)
 Set if a default spinner should show when loading the webpage. More...
 
void SetSpinnerLabelText (string text)
 Set the label text for the spinner showing when webview loading. The default value is "Loading..." More...
 
void SetUseWideViewPort (bool use)
 Set to use wide view port support or not. More...
 
void LoadWithOverviewMode (bool overview)
 Set to load with overview mode or not. More...
 
bool CanGoBack ()
 Determines whether the webview can go back. More...
 
bool CanGoForward ()
 Determines whether this webview can go forward. More...
 
void GoBack ()
 Go to the previous page if there is any one. More...
 
void GoForward ()
 Go to the next page if there is any one. More...
 
void AddPermissionRequestTrustSite (string url)
 Add a url to white list of permission request trust sites. More...
 
void AddUrlScheme (string scheme)
 Adds the URL scheme. After be added, all link of this scheme will send a message when clicked. More...
 
void RemoveUrlScheme (string scheme)
 Removes the URL scheme. After be removed, this kind of url will be handled by the webview. More...
 
void SetHeaderField (string key, string value)
 Set the header field. More...
 
void SetVerticalScrollBarShow (bool show)
 Set visibility of vertical bar for the web view. More...
 
void SetHorizontalScrollBarShow (bool show)
 Set visibility of horizontal bar for the web view. More...
 

Static Public Member Functions

static void SetUserAgent (string value)
 Set user agent string for webview. This method has no effect on the webviews which are already initiated. The user agent of a UniWebView component can not be changed once it is created. If you want to change the user agent for the webview, you have to call it before creating the UniWebView instance. More...
 
static void ResetUserAgent ()
 Reset the user agent of webview. This method has no effect on the webviews which are already initiated. The user agent of a UniWebView component can not be changed once it is created. If you want to set user agent, use the SetUserAgent method. More...
 
static void SetDoneButtonText (string text)
 Set the text in Done button of tool bar in iOS. User could use this button in iOS to close the web view. By default, "Done" will be shown for this button. If you want to change the text of tool bar done button for the webview, you have to call it before creating the UniWebView instance. This method only works for iOS. See

See also
ShowToolBar

. More...

 
static void SetWebContentsDebuggingEnabled (bool enabled)
 Set web content could be debug or not. Only works for Android. More...
 

Public Attributes

string url
 The url this UniWebView should load. You should set it before loading webpage. Do not use this value when you want to get the url of current page. It is only for loading the first page. The value will not change as the users navigating between the pages. Use

See also
currentUrl

if you want to know current url. More...

 
bool loadOnStart
 If true, load the set url when in script's Start() method. Otherwise, you should call Load() method yourself. More...
 
bool autoShowWhenLoadComplete
 If true, show the webview automatically when it finished loading. Otherwise, you should listen the OnLoadComplete event and call Show() method your self. More...
 
bool toolBarShow = false
 If the tool bar is showing or not. More...
 

Properties

UniWebViewEdgeInsets insets [get, set]
 Gets or sets the insets of a UniWebView object. More...
 
string currentUrl [get]
 Gets the current URL of the web page. More...
 
bool backButtonEnable [get, set]
 Gets or sets a value indicating whether the back button of this UniWebView is enabled. More...
 
bool bouncesEnable [get, set]
 Gets or sets a value indicating whether this UniWebView can bounces or not. More...
 
bool zoomEnable [get, set]
 Gets or sets a value indicating whether this UniWebView can be zoomed or not. More...
 
string userAgent [get]
 Get the user agent of this webview. More...
 
float alpha [get, set]
 Get or set the alpha of current webview. More...
 
bool openLinksInExternalBrowser [get, set]
 Whether the new page should be opened in an external browser when user clicks a link. More...
 
bool immersiveMode [get, set]
 Get or set a value indicating whether this UniWebView is in immersive mode. More...
 

Events

LoadCompleteDelegate OnLoadComplete
 Occurs when a UniWebView finished loading a webpage. More...
 
LoadBeginDelegate OnLoadBegin
 Occurs when a UniWebView began to load a webpage. More...
 
ReceivedMessageDelegate OnReceivedMessage
 Occurs when a UniWebView received message. More...
 
EvalJavaScriptFinishedDelegate OnEvalJavaScriptFinished
 Occurs when a UniWebView finishes eval a javascript and returned something. More...
 
WebViewShouldCloseDelegate OnWebViewShouldClose
 Occurs when on web view will be closed by native. Ask if this webview should be closed or not. More...
 
ReceivedKeyCodeDelegate OnReceivedKeyCode
 Occurs when users clicks or taps any key while webview is actived. This event only fired on Android. More...
 
InsetsForScreenOreitationDelegate InsetsForScreenOreitation
 Called when the webview need to know the insets for calculating webview's frame. More...
 

Detailed Description

The main class of UniWebView.

Each gameObject with this script represent a webview object in system. Be careful: when this script's Awake() get called, it will change the name of the gameObject to make it unique in the game. So make sure this script is appeneded to a gameObject that you don't care its name.

Member Function Documentation

§ AddJavaScript()

void UniWebView.AddJavaScript ( string  javaScript)

Add some javascript to the web page.

Parameters
javaScriptSome javascript code you want to add to the page.

This method will execute the input javascript code without raising an OnEvalJavaScriptFinished event. You can use this method to add some customized js function to the web page, then use EvaluatingJavaScript(string javaScript) to execute it. This method will add js in a async way in Android, so you should call it earlier than EvaluatingJavaScript

§ AddPermissionRequestTrustSite()

void UniWebView.AddPermissionRequestTrustSite ( string  url)

Add a url to white list of permission request trust sites.

This method only works in Android. In Android, if you request audio or video accessibility from web page, you should add the site url to a white list by using this method, or it will not be granted to use those protected resources. There is no need to call it in iOS, and this method will do nothing in platforms other than Android. For more about Android protected permission, see https://developer.android.com/reference/android/webkit/PermissionRequest.html.

Parameters
urlURL.

§ AddUrlScheme()

void UniWebView.AddUrlScheme ( string  scheme)

Adds the URL scheme. After be added, all link of this scheme will send a message when clicked.

Parameters
schemeScheme.

The scheme should not contain "://". For example, if you want to receive a url like "xyz://mydomian.com", you can pass "xyz" here.

§ CanGoBack()

bool UniWebView.CanGoBack ( )

Determines whether the webview can go back.

Returns
true if this instance can go back, which means there is at least one page in the navigation stack below; otherwise, false.

§ CanGoForward()

bool UniWebView.CanGoForward ( )

Determines whether this webview can go forward.

Returns
true if this instance can go forward, which means the user did at least once back; otherwise, false.

§ CleanCache()

void UniWebView.CleanCache ( )

Clean the cache of this UniWebView.

§ CleanCookie()

void UniWebView.CleanCookie ( string  key = null)

Clean the cookie using in the app.

Parameters
keyThe key under which you want to clean the cache.

Try to clean cookies under the specified key using in the app. If you leave the key as null or send an empty string as key, all cache will be cleared. This method will clear the cookies in memory and try to sync the change to disk. The memory opreation will return right away, but the disk operation is async and could take some time. Caution, in Android, there is no way to remove a specified cookie. So this method will call setCookie method with the key to set it to an empty value instead. Please refer to Android documentation on CookieManager for more information. The key parameter will be ignored at all on Windows Phone 8. All cookie will be cleared.

§ EvalJavaScriptFinishedDelegate()

delegate void UniWebView.EvalJavaScriptFinishedDelegate ( UniWebView  webView,
string  result 
)

§ EvaluatingJavaScript()

void UniWebView.EvaluatingJavaScript ( string  javaScript)

Send a piece of javascript to the web page and evaluate (execute) it.

Parameters
javaScriptA single javascript method call to be sent to and executed in web page

Although you can write complex javascript code and evaluate it at once, a suggest way is calling this method with a single js method name. The webview will try evaluate (execute) the javascript. When it finished, OnEvalJavaScriptFinished will be raised with the result. You can add your js function to the html page by referring to the js file in your html page, or add it by using AddJavaScript(string javaScript) method.

§ GoBack()

void UniWebView.GoBack ( )

Go to the previous page if there is any one.

§ GoForward()

void UniWebView.GoForward ( )

Go to the next page if there is any one.

§ Hide()

void UniWebView.Hide ( bool  fade = false,
UniWebViewTransitionEdge  direction = UniWebViewTransitionEdge.None,
float  duration = 0.4f,
Action  finishAction = null 
)

Hide this UniWebView.

Calling this method on a UniWebView will hide it.

§ HideToolBar()

void UniWebView.HideToolBar ( bool  animate)

Hide the tool bar. The tool bar contains three buttons: go back, go forward and close webview.

Parameters
animateIf set to true, show it with an animation.

The tool bar is only available in iOS. For Android and Windows Phone, you can use the back button of device to go back.

§ InsetsForScreenOreitationDelegate()

delegate UniWebViewEdgeInsets UniWebView.InsetsForScreenOreitationDelegate ( UniWebView  webView,
UniWebViewOrientation  orientation 
)

§ Load() [1/2]

void UniWebView.Load ( )

Load the url set in

See also
url

property of this UniWebView.

§ Load() [2/2]

void UniWebView.Load ( string  aUrl)

A alias method to load a specified url.

Parameters
aUrlA url to set and load

It will set the url of this UniWebView and then call Load it.

§ LoadBeginDelegate()

delegate void UniWebView.LoadBeginDelegate ( UniWebView  webView,
string  loadingUrl 
)

§ LoadCompleteDelegate()

delegate void UniWebView.LoadCompleteDelegate ( UniWebView  webView,
bool  success,
string  errorMessage 
)

§ LoadHTMLString()

void UniWebView.LoadHTMLString ( string  htmlString,
string  baseUrl 
)

Load a HTML string.

Parameters
htmlStringThe content HTML string for the web page.
baseUrlThe base URL in which the webview should to refer other resources

If you want to specify a local baseUrl, you need to encode it to proper format. See the "Can I load some html string by using UniWebView?" section in FAQ page (http://uniwebview.onevcat.com/faqs.html) for more.

§ LoadWithOverviewMode()

void UniWebView.LoadWithOverviewMode ( bool  overview)

Set to load with overview mode or not.

Parameters
overviewIf set to true, use overview mode to load the page.

This method only works for Android. If you need to load your page with overview mode, you may want to enable it before you loading and showing your page.

§ ReceivedKeyCodeDelegate()

delegate void UniWebView.ReceivedKeyCodeDelegate ( UniWebView  webView,
int  keyCode 
)

§ ReceivedMessageDelegate()

delegate void UniWebView.ReceivedMessageDelegate ( UniWebView  webView,
UniWebViewMessage  message 
)

§ Reload()

void UniWebView.Reload ( )

Reload current page.

§ RemoveUrlScheme()

void UniWebView.RemoveUrlScheme ( string  scheme)

Removes the URL scheme. After be removed, this kind of url will be handled by the webview.

Parameters
schemeScheme.

§ ResetUserAgent()

static void UniWebView.ResetUserAgent ( )
static

Reset the user agent of webview. This method has no effect on the webviews which are already initiated. The user agent of a UniWebView component can not be changed once it is created. If you want to set user agent, use the SetUserAgent method.

§ SetBackgroundColor()

void UniWebView.SetBackgroundColor ( Color  color)

Set the background color of webview.

Set the background color of the webview. In iOS, it will only take in action when the web page has no background color from css. There is no way to set Windows Phone 8, so this method will do noting on Windows Phone. And in OSX Editor, it is limited and can be only used to set white or clear background.

§ SetDoneButtonText()

static void UniWebView.SetDoneButtonText ( string  text)
static

Set the text in Done button of tool bar in iOS. User could use this button in iOS to close the web view. By default, "Done" will be shown for this button. If you want to change the text of tool bar done button for the webview, you have to call it before creating the UniWebView instance. This method only works for iOS. See

See also
ShowToolBar

.

Parameters
textThe text you want to show for the Done button. Set it to null will reset it to "Done".

§ SetHeaderField()

void UniWebView.SetHeaderField ( string  key,
string  value 
)

Set the header field.

Specify customized header field for the next url loading. You could call this method multiple times to add key/value pairs for different fields. Only the requests by using Load() method of current web view will use these setting for header.

Parameters
keyKey of the header field. Empty string or null will be ignored.
valueValue of the header field. Pass null to remove an existing value. Empty string will be ignored.

§ SetHorizontalScrollBarShow()

void UniWebView.SetHorizontalScrollBarShow ( bool  show)

Set visibility of horizontal bar for the web view.

This method will not work for editor and Windows Phone 8.

Parameters
showWhether the horizontal scroll bar should be visible or not when the web view is being scrolled.

§ SetShowSpinnerWhenLoading()

void UniWebView.SetShowSpinnerWhenLoading ( bool  show)

Set if a default spinner should show when loading the webpage.

The default value is true, which means a spinner will show when the webview is on, and it is loading some thing. The spinner contains a label and you can set a message to it. You can set it false if you do not want a spinner show when loading. A progress bar will be used in Windows Phone instead of a spinner.

Parameters
showIf set to true show.

§ SetSpinnerLabelText()

void UniWebView.SetSpinnerLabelText ( string  text)

Set the label text for the spinner showing when webview loading. The default value is "Loading..."

Parameters
textText.

There is no text for Windows Phone spinner, so it will do noting for it.

§ SetTransparentBackground()

void UniWebView.SetTransparentBackground ( bool  transparent = true)

Set the background of webview to transparent.

In iOS, there is a grey background in webview. If you don't want it, just call this method to set it transparent. There is no way to set Windows Phone 8 background to transparent, so this method will do noting on Windows Phone.

§ SetUserAgent()

static void UniWebView.SetUserAgent ( string  value)
static

Set user agent string for webview. This method has no effect on the webviews which are already initiated. The user agent of a UniWebView component can not be changed once it is created. If you want to change the user agent for the webview, you have to call it before creating the UniWebView instance.

Parameters
valueThe value user agent should be. Set it to null will reset the user agent to the default one.

§ SetUseWideViewPort()

void UniWebView.SetUseWideViewPort ( bool  use)

Set to use wide view port support or not.

Parameters
useIf set to true use view port tag in the html to determine the layout.

This method only works (and be necessary) for Android. If you are using viewport tag in you page, you may want to enable it before you loading and showing your page.

§ SetVerticalScrollBarShow()

void UniWebView.SetVerticalScrollBarShow ( bool  show)

Set visibility of vertical bar for the web view.

This method will not work for editor and Windows Phone 8.

Parameters
showWhether the vertical scroll bar should be visible or not when the web view is being scrolled.

§ SetWebContentsDebuggingEnabled()

static void UniWebView.SetWebContentsDebuggingEnabled ( bool  enabled)
static

Set web content could be debug or not. Only works for Android.

You can enable Remote Debugging for Android devices by calling this method and passing true. See Google's Remote Debugging Android Devices documentation for more about it. https://developers.google.com/web/tools/chrome-devtools/debug/remote-debugging/remote-debugging

This method will do nothing for iOS or editor.

Parameters
enabledWhether this page could be debug or not.

§ Show()

void UniWebView.Show ( bool  fade = false,
UniWebViewTransitionEdge  direction = UniWebViewTransitionEdge.None,
float  duration = 0.4f,
Action  finishAction = null 
)

Show this UniWebView on screen.

Usually, it should be called when you get the LoadCompleteDelegate raised with a success flag true. The webview will not be visible until this method is called.

§ ShowToolBar()

void UniWebView.ShowToolBar ( bool  animate)

Show the tool bar. The tool bar contains three buttons: go back, go forward and close webview.

Parameters
animateIf set to true, show it with an animation.

The tool bar is only available in iOS. In Android and Windows Phone, you can use the back button of device to go back.

§ Stop()

void UniWebView.Stop ( )

Stop loading the current request. It will do nothing if the webpage is not loading.

§ WebViewShouldCloseDelegate()

delegate bool UniWebView.WebViewShouldCloseDelegate ( UniWebView  webView)

Member Data Documentation

§ autoShowWhenLoadComplete

bool UniWebView.autoShowWhenLoadComplete

If true, show the webview automatically when it finished loading. Otherwise, you should listen the OnLoadComplete event and call Show() method your self.

§ loadOnStart

bool UniWebView.loadOnStart

If true, load the set url when in script's Start() method. Otherwise, you should call Load() method yourself.

§ toolBarShow

bool UniWebView.toolBarShow = false

If the tool bar is showing or not.

This parameter is only available in iOS. In other platform, it will be always false. It will take no effect when you set this after you call Show on the webview. Use ShowToolBar and HideToolBar instead if the webview is already showing.

§ url

string UniWebView.url

The url this UniWebView should load. You should set it before loading webpage. Do not use this value when you want to get the url of current page. It is only for loading the first page. The value will not change as the users navigating between the pages. Use

See also
currentUrl

if you want to know current url.

Property Documentation

§ alpha

float UniWebView.alpha
getset

Get or set the alpha of current webview.

The alpha.

This value indicates the alpha of webview. The value should be between 0.0~1.0, which 1.0 means opaque and 0.0 is transparent. This property will work on iOS, Android and WP8. In editor it will be always 1.0 and opaque.

§ backButtonEnable

bool UniWebView.backButtonEnable
getset

Gets or sets a value indicating whether the back button of this UniWebView is enabled.

It is only for Android and Windows Phone 8. If set true, users can use the back button of these devices to goBack or close the web view if there is nothing to goBack. Otherwise, the back button will do nothing when the webview is shown. When set true, Unity will not receive the Input.KeyDown or other similar event in Android. You could use

See also
OnReceivedKeyCode

to watch the key event instead. This value means nothing for iOS, since there is no back button for iOS devices.

true if back button enabled; otherwise, false. Default is true

.

§ bouncesEnable

bool UniWebView.bouncesEnable
getset

Gets or sets a value indicating whether this UniWebView can bounces or not.

The default iOS webview has a bounces effect when drag out of edge. The default Android webview has a color indicator when drag beyond the edge. UniWebView disabled these bounces effect by default. If you want the bounces, set this property to true. This property does noting in editor or Windows Phone 8.

true if bounces enable; otherwise, false.

§ currentUrl

string UniWebView.currentUrl
get

Gets the current URL of the web page.

The current URL of this webview.

This value indicates the main frame url of the webpage. It will be updated only when the webpage finishs or fails loading.

§ immersiveMode

bool UniWebView.immersiveMode
getset

Get or set a value indicating whether this UniWebView is in immersive mode.

true if immersive mode; otherwise, false.

§ insets

UniWebViewEdgeInsets UniWebView.insets
getset

Gets or sets the insets of a UniWebView object.

The insets in point from top, left, bottom and right edge from the screen.

Default value is UniWebViewEdgeInsets(0,0,0,0), which means a full screen webpage. If you want use different insets in portrait and landscape screen, use InsetsForScreenOreitation

§ openLinksInExternalBrowser

bool UniWebView.openLinksInExternalBrowser
getset

Whether the new page should be opened in an external browser when user clicks a link.

A boolean indicates link clicking should be opened externally or not.

If true, when user clicks on a link, an external web page browser on the device will be opened and direct to the target link. It will be useful if you need navigate your user to a device installed browser (like Mobile Safari on iOS or Chrome on Android). This will only work when your user click a link in your page. Due to the lack detection of Android web view, some javascript embedded link will not be able to open externally correctly. If you need more control of it, consider to add all http/https scheme with AddUrlScheme method and handle them case by case in the OnReceivedMessage callback. The default value is false, which means all link clicking will be opened in place.

§ userAgent

string UniWebView.userAgent
get

Get the user agent of this webview.

The string of user agent using by the webview.

It is a read-only property of webview. Once it is set when the webview gets created, the user agent can not be changed again. If you want to use a customized user agent, you should call SetUserAgent method before create a webview component.

§ zoomEnable

bool UniWebView.zoomEnable
getset

Gets or sets a value indicating whether this UniWebView can be zoomed or not.

If true, users can zoom in or zoom out the webpage by a pinch gesture. This propery will valid immediately on Android. But on iOS, it will not valid until the next page loaded. You can set this property before page loading, or use Reload() to refresh current page to make it valid. This property does noting in Windows Phone 8, since there is no way to control the default behavior for it. If you need to disable users zoom or pinch guesture, you need to add a viewport tag with "user-scalable=no" to your page.

true if zoom enabled; otherwise, false.

Default is false.

Event Documentation

§ InsetsForScreenOreitation

InsetsForScreenOreitationDelegate UniWebView.InsetsForScreenOreitation

Called when the webview need to know the insets for calculating webview's frame.

If you need to show web content in both portrait and landscpace mode, you might want to specify different insets for the screen orientation separately. This event will be called when the Show() method gets called and the screen orientation changes. You can implement this method and check current orientation, then return correct insets. If this event is not implemented, the old insets value will be used to resize the webview size. If you do not use auto-rotating in your webview, you can ignore this method and just set the insets property directly.

§ OnEvalJavaScriptFinished

EvalJavaScriptFinishedDelegate UniWebView.OnEvalJavaScriptFinished

Occurs when a UniWebView finishes eval a javascript and returned something.

You can use EvaluatingJavaScript method to make the webview to eval a js. The string-returned version of EvaluatingJavaScript is removed. You should always listen this event to get the result of js.

§ OnLoadBegin

LoadBeginDelegate UniWebView.OnLoadBegin

Occurs when a UniWebView began to load a webpage.

You can do something with the UniWebView passed by parameter to get some info or do your things when a url begins to load Sometimes, the webpage contains some other parts besides of the main frame. Whenever these parts begin to load, this event will be fired. You can get the url from parameter to know what url is about to be loaded. It is useful when you want to get some parameters from url when user clicked a link.

§ OnLoadComplete

LoadCompleteDelegate UniWebView.OnLoadComplete

Occurs when a UniWebView finished loading a webpage.

If loading finished successfully, success will be true, otherwise false and with an errorMessage.

§ OnReceivedKeyCode

ReceivedKeyCodeDelegate UniWebView.OnReceivedKeyCode

Occurs when users clicks or taps any key while webview is actived. This event only fired on Android.

On Android, the key down event can not be passed back to Unity due to some issue in Unity 4.3's Android Player. As result, you are not able to get the key input on Android by just using Unity's Input.GetKeyDown or GetKey method. If you want to know the user input while the webview on, you can subscribe this event. This event will be fired with a int number indicating the key code tapped as parameter. You can refer to Android's documentation to find out which key is tapped (http://developer.android.com/reference/android/view/KeyEvent.html) This event will be never raised on iOS, because iOS forbids the tracking of user's keyboard or device button events.

§ OnReceivedMessage

ReceivedMessageDelegate UniWebView.OnReceivedMessage

Occurs when a UniWebView received message.

If a url with format of "uniwebview://yourPath?param1=value1&param2=value2" clicked, this event will get raised with a UniWebViewMessage object.

§ OnWebViewShouldClose

WebViewShouldCloseDelegate UniWebView.OnWebViewShouldClose

Occurs when on web view will be closed by native. Ask if this webview should be closed or not.

The users can close the webView by tapping back button (Android) or done button (iOS). When the webview will be closed, this event will be raised. If you return false, the webview will not be closed. If you did not implement it, webview will be closed.


The documentation for this class was generated from the following file: