# SocketTask.onMessage(function callback)
with Promise style call: Not supported
Mini Program plugin: Support
to monitor WebSocket Message event received from server
# parameter
# function callback
WebSocket Callback function to receive message events from the server
# parameter
# Object res
attribute | type | Introductions |
---|---|---|
data | string/ArrayBuffer | Message returned by the server |