public class PluginManager
extends java.lang.Object
Constructor and Description |
---|
PluginManager(CordovaWebView cordovaWebView,
CordovaInterface cordova,
java.util.Collection<PluginEntry> pluginEntries) |
Modifier and Type | Method and Description |
---|---|
void |
addService(PluginEntry entry)
Add a plugin classes that implements a service to the service entry table.
|
void |
addService(java.lang.String service,
java.lang.String className)
Add a plugin classes that implements a service to the service entry table.
|
void |
exec(java.lang.String service,
java.lang.String action,
java.lang.String callbackId,
java.lang.String rawArgs)
Receives a request for execution and fulfills it by finding the appropriate
Java classes and calling it's execute method.
|
CordovaPlugin |
getPlugin(java.lang.String service)
Get the plugin object that implements the service.
|
java.util.Collection<PluginEntry> |
getPluginEntries() |
void |
init()
Init when loading a new HTML page into webview.
|
void |
onConfigurationChanged(android.content.res.Configuration newConfig)
Called by the system when the device configuration changes while your activity is running.
|
void |
onDestroy()
The final call you receive before your activity is destroyed.
|
void |
onNewIntent(android.content.Intent intent)
Called when the activity receives a new intent.
|
boolean |
onOverrideUrlLoading(java.lang.String url)
Called when the URL of the webview changes.
|
void |
onPause(boolean multitasking)
Called when the system is about to start resuming a previous activity.
|
boolean |
onReceivedClientCertRequest(CordovaWebView view,
ICordovaClientCertRequest request)
Called when he system received an SSL client certificate request.
|
boolean |
onReceivedHttpAuthRequest(CordovaWebView view,
ICordovaHttpAuthHandler handler,
java.lang.String host,
java.lang.String realm)
Called when the system received an HTTP authentication request.
|
void |
onReset()
Called when the app navigates or refreshes.
|
void |
onResume(boolean multitasking)
Called when the activity will start interacting with the user.
|
android.os.Bundle |
onSaveInstanceState() |
void |
onStart()
Called when the activity is becoming visible to the user.
|
void |
onStop()
Called when the activity is no longer visible to the user.
|
java.lang.Object |
postMessage(java.lang.String id,
java.lang.Object data)
Send a message to all plugins.
|
void |
setPluginEntries(java.util.Collection<PluginEntry> pluginEntries) |
boolean |
shouldAllowBridgeAccess(java.lang.String url)
Called when the webview is requesting the exec() bridge be enabled.
|
boolean |
shouldAllowNavigation(java.lang.String url)
Called when the webview is going to change the URL of the loaded content.
|
boolean |
shouldAllowRequest(java.lang.String url)
Called when the webview is going to request an external resource.
|
java.lang.Boolean |
shouldOpenExternalUrl(java.lang.String url)
Called when the webview is going not going to navigate, but may launch
an Intent for an URL.
|
public PluginManager(CordovaWebView cordovaWebView, CordovaInterface cordova, java.util.Collection<PluginEntry> pluginEntries)
public java.util.Collection<PluginEntry> getPluginEntries()
public void setPluginEntries(java.util.Collection<PluginEntry> pluginEntries)
public void init()
public void exec(java.lang.String service, java.lang.String action, java.lang.String callbackId, java.lang.String rawArgs)
service
- String containing the service to runaction
- String containing the action that the classes is supposed to perform. This is
passed to the plugin execute method and it is up to the plugin developer
how to deal with it.callbackId
- String containing the id of the callback that is execute in JavaScript if
this is an async plugin call.rawArgs
- An Array literal string containing any arguments needed in the
plugin execute method.public CordovaPlugin getPlugin(java.lang.String service)
service
- The name of the service.public void addService(java.lang.String service, java.lang.String className)
service
- The service nameclassName
- The plugin classes namepublic void addService(PluginEntry entry)
entry
- The plugin entrypublic void onPause(boolean multitasking)
multitasking
- Flag indicating if multitasking is turned on for apppublic boolean onReceivedHttpAuthRequest(CordovaWebView view, ICordovaHttpAuthHandler handler, java.lang.String host, java.lang.String realm)
view
- The WebView that is initiating the callbackhandler
- The HttpAuthHandler used to set the WebView's responsehost
- The host requiring authenticationrealm
- The realm for which authentication is requiredpublic boolean onReceivedClientCertRequest(CordovaWebView view, ICordovaClientCertRequest request)
view
- The WebView that is initiating the callbackrequest
- The client certificate requestpublic void onResume(boolean multitasking)
multitasking
- Flag indicating if multitasking is turned on for apppublic void onStart()
public void onStop()
public void onDestroy()
public java.lang.Object postMessage(java.lang.String id, java.lang.Object data)
id
- The message iddata
- The message datapublic void onNewIntent(android.content.Intent intent)
public boolean shouldAllowRequest(java.lang.String url)
url
- The URL that is being requested.public boolean shouldAllowNavigation(java.lang.String url)
url
- The URL that is being requested.public boolean shouldAllowBridgeAccess(java.lang.String url)
public java.lang.Boolean shouldOpenExternalUrl(java.lang.String url)
url
- The URL that is being requested.public boolean onOverrideUrlLoading(java.lang.String url)
url
- The URL that is being changed to.public void onReset()
public void onConfigurationChanged(android.content.res.Configuration newConfig)
newConfig
- The new device configurationpublic android.os.Bundle onSaveInstanceState()