Android: Close websocket properly when remote server initiates close (#22248)
Summary: When the remote server closes the websocket, the app doesn't get a 'close' event in Android, There is no issue on iOS. Pull Request resolved: https://github.com/facebook/react-native/pull/22248 Differential Revision: D13047556 Pulled By: hramos fbshipit-source-id: c5c56ea8418cfdf734fb51f863b3066856de6512
This commit is contained in:
Родитель
339d9d3afb
Коммит
2e465bca15
|
@ -147,6 +147,11 @@ public final class WebSocketModule extends ReactContextBaseJavaModule {
|
|||
sendEvent("websocketOpen", params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClosing(WebSocket websocket, int code, String reason) {
|
||||
websocket.close(code, reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClosed(WebSocket webSocket, int code, String reason) {
|
||||
WritableMap params = Arguments.createMap();
|
||||
|
|
Загрузка…
Ссылка в новой задаче