Skip to content

Commit

Permalink
Fix WebSocket on Android by using Platform.OS check
Browse files Browse the repository at this point in the history
Same fix as 31a1b72
ide committed Jun 13, 2018
1 parent 87df7b5 commit fd450e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Libraries/WebSocket/WebSocket.js
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
const Blob = require('../Blob/Blob');
const EventTarget = require('event-target-shim');
const NativeEventEmitter = require('../EventEmitter/NativeEventEmitter');
const Platform = require('../Utilities/Platform');
const BlobManager = require('../Blob/BlobManager');
const NativeModules = require('../BatchedBridge/NativeModules');
const WebSocketEvent = require('./WebSocketEvent');
@@ -202,7 +203,7 @@ class WebSocket extends EventTarget(...WEBSOCKET_EVENTS) {
}

_close(code?: number, reason?: string): void {
if (WebSocketModule.close.length === 3) {
if (Platform.OS === 'android') {
// See https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent
const statusCode = typeof code === 'number' ? code : CLOSE_NORMAL;
const closeReason = typeof reason === 'string' ? reason : '';

0 comments on commit fd450e6

Please sign in to comment.