Skip to content

Commit

Permalink
add disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunshow committed Mar 18, 2022
1 parent c6a5977 commit 385f109
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions module/src/main/java/io/dcloud/uniplugin/TruTestUniModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@ public void isConnected(UniJSCallback callback) {
}
}

@UniJSMethod(uiThread = true)
public void disconnect(UniJSCallback callback) {
Log.e(TAG, "disconnect");
TruTestClient.instance.disconnect();
if (callback != null) {
JSONObject data = new JSONObject();
data.put("code", 0);
callback.invoke(data);
}
}


@UniJSMethod(uiThread = true)
public void startConnection(JSONObject options, UniJSCallback callback) {
Log.e(TAG, "startConnection: " + options);
Expand Down

0 comments on commit 385f109

Please sign in to comment.