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
  • Loading branch information
ide committed Jul 11, 2018
1 parent c958079 commit 0b4c6d1
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
Expand Up @@ -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');
Expand Down Expand Up @@ -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 : '';
Expand Down

0 comments on commit 0b4c6d1

Please sign in to comment.