WebSocketModule

class WebSocketModule(context: ReactApplicationContext) : NativeWebSocketModuleSpec

Constructors

Link copied to clipboard
constructor(context: ReactApplicationContext)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
interface ContentHandler

Functions

Link copied to clipboard
open override fun addListener(eventName: String)
Link copied to clipboard
open override fun canOverrideExistingModule(): Boolean

Return true if you intend to override some other native module that was registered e.g. as part of a different package (such as the core one). Trying to override without returning true from this method is considered an error and will throw an exception during initialization. By default all modules return false.

Link copied to clipboard
open override fun close(code: Double, reason: String?, socketID: Double)
Link copied to clipboard
open override fun connect(url: String, protocols: ReadableArray?, options: ReadableMap?, socketID: Double)
Link copied to clipboard
Link copied to clipboard
open override fun getName(): String
Link copied to clipboard
open override fun initialize()

This method is called after ReactApplicationContext has been created.

Link copied to clipboard
open override fun invalidate()

The CatalystInstance is going away with Venice. Therefore, the TurboModule infra introduces the invalidate() method to allow NativeModules to clean up after themselves.

Link copied to clipboard

Allow NativeModule to clean up. Called before {CatalystInstance#onHostDestroy}

Link copied to clipboard
open override fun ping(socketID: Double)
Link copied to clipboard
open override fun removeListeners(count: Double)
Link copied to clipboard
open override fun send(message: String, socketID: Double)
Link copied to clipboard
open override fun sendBinary(base64String: String, socketID: Double)
fun sendBinary(byteString: ByteString, id: Int)
Link copied to clipboard