-
- All Implemented Interfaces:
-
com.facebook.react.bridge.JavaJSExecutor
public class WebsocketJavaScriptExecutor implements JavaJSExecutor
Executes JS remotely via the react nodejs server as a proxy to a browser on the host machine.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceWebsocketJavaScriptExecutor.JSExecutorConnectCallbackpublic classWebsocketJavaScriptExecutor.WebsocketExecutorTimeoutException
-
Method Summary
Modifier and Type Method Description voidconnect(String webSocketServerUrl, WebsocketJavaScriptExecutor.JSExecutorConnectCallback callback)voidclose()Close this executor and cleanup any resources that it was using. voidloadBundle(String sourceURL)Load javascript into the js context StringexecuteJSCall(String methodName, String jsonArgsArray)Execute javascript method within js context voidsetGlobalVariable(String propertyName, String jsonEncodedValue)-
-
Method Detail
-
connect
void connect(String webSocketServerUrl, WebsocketJavaScriptExecutor.JSExecutorConnectCallback callback)
-
close
void close()
Close this executor and cleanup any resources that it was using. No further calls are expectedafter this.
-
loadBundle
void loadBundle(String sourceURL)
Load javascript into the js context
- Parameters:
sourceURL- url or file location from which script content was loaded
-
executeJSCall
@Nullable() String executeJSCall(String methodName, String jsonArgsArray)
Execute javascript method within js context
- Parameters:
methodName- name of the method to be executedjsonArgsArray- json encoded array of arguments provided for the method call
-
setGlobalVariable
void setGlobalVariable(String propertyName, String jsonEncodedValue)
-
-
-
-