Android Question How to raise onmessage event websocket

Reids

Member
Licensed User
Hello, I tried to create simple websocket echo server, web based client is received the message and other web socket client worked because there is onmessage event, but client in basic4android cannot raise event when message received
what event for receiving the message? doc only say this lib only has 3 event

Connected
Closed (Reason As String)
TextMessage (Message As String)

but there is not Onmessage event, I also tried to use method as mentioned here
here the code
B4X:
Sub Timer1_Tick
'This method will raise the event on the device
   ws.RunFunction("ServerTime", Array As Object(DateTime.Time(DateTime.Now)))
   ws.Flush

but ws doesn't have ws.RunFunction :(

Thank You



EDITED:
Nevermind accidentially already found it

shuld call event manualy by
CallSub2(CallBack, "ws_TextMessage" & "_" & "onmessage", params)
 
Last edited:
Top