Fix the WebSocket sendBinary error

Summary:
Fixing the WebSocket SendBinary method error. This is a regression caused during recent change.
Closes https://github.com/facebook/react-native/pull/7956

Differential Revision: D3398065

fbshipit-source-id: 5d56eba807b59d1f3265cba5d5f501d610afebf2
This commit is contained in:
Sreejumon 2016-06-07 01:50:57 -07:00 committed by Facebook Github Bot 0
parent 46c02b6ae5
commit 7742900931
1 changed files with 1 additions and 1 deletions

View File

@ -223,7 +223,7 @@ public class WebSocketModule extends ReactContextBaseJavaModule {
throw new RuntimeException("Cannot send a message. Unknown WebSocket id " + id);
}
try {
client.sendMessage(RequestBody.create(WebSocket.TEXT, ByteString.decodeBase64(base64String)));
client.sendMessage(RequestBody.create(WebSocket.BINARY, ByteString.decodeBase64(base64String)));
} catch (IOException | IllegalStateException e) {
notifyWebSocketFailed(id, e.getMessage());
}