-
- 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 interface
WebsocketJavaScriptExecutor.JSExecutorConnectCallback
public class
WebsocketJavaScriptExecutor.WebsocketExecutorTimeoutException
-
Method Summary
Modifier and Type Method Description void
connect(String webSocketServerUrl, WebsocketJavaScriptExecutor.JSExecutorConnectCallback callback)
void
close()
Close this executor and cleanup any resources that it was using. void
loadBundle(String sourceURL)
Load javascript into the js context String
executeJSCall(String methodName, String jsonArgsArray)
Execute javascript method within js context void
setGlobalVariable(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)
-
-
-
-