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, getReactApplicationContextIfActiveOrWarncanOverrideExistingModule, getConstants, hasConstants, initialize, invalidate, onCatalystInstanceDestroyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinvalidatepublic 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 NativeWebSocketModuleSpecpublic void close(double code,
java.lang.String reason,
double socketID)
close in class NativeWebSocketModuleSpecpublic void send(java.lang.String message,
double socketID)
send in class NativeWebSocketModuleSpecpublic void sendBinary(java.lang.String base64String,
double socketID)
sendBinary in class NativeWebSocketModuleSpecpublic void sendBinary(ByteString byteString,
int id)
public void ping(double socketID)
ping in class NativeWebSocketModuleSpecpublic void addListener(java.lang.String eventName)
addListener in class NativeWebSocketModuleSpecpublic void removeListeners(double count)
removeListeners in class NativeWebSocketModuleSpec