-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
could we ack when we receive a new event #379
Comments
Yes I read it before, but if I'm receiving a string from the server how I can ack this event socket.on("new_message",(data)=>{ |
Heyy, I had the same issue and figured out the solution. It's pretty easy, it's the lack of information in the documentation that makes it hard to figure out. I'll show you my example: in my server side I send a nudge to the client, when you send it, the client receives a list of data, consists of the data you sent in the emit and an extra callback function that should be used for acks: so this is how the data might look like if you used my code below:
That's why in flutter you'll need to treat the data received as a list, and extract from it both data sent from server and the function; you can handle the data as you like, and the take the last item as Function and run it as described in their code sample:
|
It stopped working in version 3. Rolled back to 2.
|
@makamekm Could you provide a reproducible example? |
`socket.on("new_message",(data)=>{
//How to ack this event?
})'`
The text was updated successfully, but these errors were encountered: