public final class WebSocketModule extends NativeWebSocketModuleSpec
Modifier and Type | Class and Description |
---|---|
static interface |
WebSocketModule.ContentHandler |
NativeModule.NativeMethod
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
static java.lang.String |
TAG |
METHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC
Constructor and Description |
---|
WebSocketModule(ReactApplicationContext context) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(java.lang.String eventName) |
void |
close(double code,
java.lang.String reason,
double socketID) |
void |
connect(java.lang.String url,
ReadableArray protocols,
ReadableMap options,
double socketID) |
java.lang.String |
getName() |
void |
ping(double socketID) |
void |
removeListeners(double count) |
void |
send(java.lang.String message,
double socketID) |
void |
sendBinary(ByteString byteString,
int id) |
void |
sendBinary(java.lang.String base64String,
double socketID) |
void |
setContentHandler(int id,
WebSocketModule.ContentHandler contentHandler) |
getCurrentActivity, getReactApplicationContext, getReactApplicationContextIfActiveOrWarn
canOverrideExistingModule, getConstants, hasConstants, initialize, invalidate, onCatalystInstanceDestroy
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
invalidate
public static final java.lang.String TAG
public static final java.lang.String NAME
public WebSocketModule(ReactApplicationContext context)
public java.lang.String getName()
require()
this module
from javascript.public void setContentHandler(int id, WebSocketModule.ContentHandler contentHandler)
public void connect(java.lang.String url, ReadableArray protocols, ReadableMap options, double socketID)
connect
in class NativeWebSocketModuleSpec
public void close(double code, java.lang.String reason, double socketID)
close
in class NativeWebSocketModuleSpec
public void send(java.lang.String message, double socketID)
send
in class NativeWebSocketModuleSpec
public void sendBinary(java.lang.String base64String, double socketID)
sendBinary
in class NativeWebSocketModuleSpec
public void sendBinary(ByteString byteString, int id)
public void ping(double socketID)
ping
in class NativeWebSocketModuleSpec
public void addListener(java.lang.String eventName)
addListener
in class NativeWebSocketModuleSpec
public void removeListeners(double count)
removeListeners
in class NativeWebSocketModuleSpec