java.lang.Object | ||
↳ | android.webkit.WebViewClient | |
↳ | com.urbanairship.widget.UAWebViewClient |
A web view client that intercepts Urban Airship URLs and enables triggering actions from javascript.
The UAWebViewClient will intercept links with the 'uairship' scheme and with the commands (supplied as the host) 'run-actions' or 'run-basic-actions'.
The run-actions command runs a set of actions listed in the URL's query
options, by providing key=value pairs, where each pair's key is the name of
an action and the value is a JSON encoded string representing the value of
the action's ActionArguments
. The JSON
encoded string is decoded and converted to a List
Example: uairship://run-actions?&add_tags=%5B%22one%22%2C%22two%22%5D will run the "add_tags" with value "["one", "two"]".
The run-basic-actions command is similar to run-actions, but the argument value is treated as a string literal.
Example: uairship://run-basic-actions?add_tags=one&remove_tags=two will run the "add_tags" with the value "one", and perform the "remove_tags" action with value "two".
When extending this class, any overridden methods should call through to the super class' implementations.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | CLOSE_COMMAND | Close command to handle close method in the Javascript Interface. | |||||||||
String | RUN_ACTIONS_COMMAND | Run actions command. | |||||||||
String | RUN_BASIC_ACTIONS_COMMAND | Run basic actions command. | |||||||||
String | UA_ACTION_SCHEME | Urban Airship's scheme. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
UAWebViewClient()
Default constructor.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
onClose(WebView webView)
Called when UAirship.close() is triggered from the Urban Airship Javascript interface.
| ||||||||||
void | onLoadResource(WebView webView, String url) | ||||||||||
void | onPageFinished(WebView view, String url) | ||||||||||
void | onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) | ||||||||||
void |
setActionCompletionCallback(ActionCompletionCallback actionCompletionCallback)
Sets the action completion callback to be invoked whenever an
Action
is finished running from the web view. | ||||||||||
boolean | shouldOverrideUrlLoading(WebView webView, String url) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Close command to handle close method in the Javascript Interface.
Run basic actions command.
Urban Airship's scheme. The web view client will override any URLs that have this scheme by default.
Default constructor.
Called when UAirship.close() is triggered from the Urban Airship Javascript interface.
The default behavior simulates a back key press.webView | The web view. |
---|
Sets the action completion callback to be invoked whenever an Action
is finished running from the web view.
actionCompletionCallback | The completion callback. |
---|