Skip to content

Commit

Permalink
(Android) Fixed issue where getConnectionState is not
Browse files Browse the repository at this point in the history
resolved properly
  • Loading branch information
marqroldan committed Apr 1, 2020
1 parent bf92d7d commit 9f786a2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions android/src/main/java/com/syan/agora/AgoraModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -1144,11 +1144,9 @@ public void enableWebSdkInteroperability(boolean enabled, Promise promise) {
@ReactMethod
public void getConnectionState(Promise promise) {
Integer res = AgoraManager.getInstance().getConnectionState();
if (res == 0) {
promise.resolve(null);
} else {
promise.reject("-1", res.toString());
}
WritableMap map = Arguments.createMap();
map.putInt("state", res);
promise.resolve(map);
}

@ReactMethod
Expand Down

0 comments on commit 9f786a2

Please sign in to comment.