Tutorial
If you want use mobile application as a server you must go step by step and do following instruction.
Methods available from master WebView
While loading the page there is object named
SystemLayer and this is injected to the page with following methods:interface SystemLayerInterface {/// Logs the information to the consolelog(string)=>void,/// This method is used to make request./// This method is async.request(Request)=>void,/// Saving the data to the storage.save(Save)=>void,/// Getting the data from the storage./// This method is async.get(Get)=>void,/// Adding new slave WebView.addNewSlaveWebView(SlaveWebView)=>void,/// Removing slave WebView.removeSlaveWebView(SlaveWebView)=>void,/// Showing to the user slave WebView.showSlaveWebView(SlaveWebView)=>void,/// Hidding WebView.hideSlaveWebView(SlaveWebView)=>void,/// Evaluates JavaScript inside slave WebViewevaluateJavaScriptInSlaveWebView(EvaluateJavaScriptSlaveWebView)=>void,/// Getting current url from slave WebView./// This method is async.getCurrentPageFromSlaveWebView(SlaveWebView)=>void,/// Loading url on slave WebView.loadPageURLInSlaveWebView(SlaveWebView)=>void,}
All objects are described here.
1. Inject methods after page loading.
After loading the page you have to inject following methods inside SystemLayer.
/// Response from request method.requestResponse(RequestResponse)=>void,/// Response from get method.getResponse(GetResponse)=>void,/// Is called when slave WebView finished page loading./// Parameter `string` is id of slave WebView./// Parameter `string` is url which was loaded.slaveWebViewPageLoaded(string, string)=>void,/// Response from getCurrentPageFromSlaveWebView method./// Parameter `string` is id of request./// Parameter `string` is url which is currently loaded.getCurrentPageFromSlaveWebViewResponse(string, string)=>void,/// Is called when slave WebView wants to send message./// Parameter `string` is the message from slave WebView.slaveWebViewSendMessage(string)
tip
When method is named
*Response thats means this is a response from method named *. EXAMPLE: When the method is namedrequestthen methodrequestResponseis for receiving information. All methods are async. There is not method which have return values. We can only