Android Question How to raise onmessage event websocket

Status
Not open for further replies.

Reids

Member
Licensed User
Longtime 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:

bubels

New Member
Licensed User
Longtime User
Hi,
I'm stuck at the same point. I have a connection to the server that sends me information with the content "reload"
I know that from a snifer.
I would like to receive this message in the application.
How can i do this ?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
How can i do this ?
Stop posting in 6 Years old threads as it is never the correct way.
Always create a new Thread for your question/issue.
Always post as much information/code that anyone can help.
I dont see how i could help with the informations you provided.
 
Upvote 0
Status
Not open for further replies.
Top