Open codeCarbConoisseur opened 4 years ago
I' m creating an Echo instance with params then a add echo.connected( callback: { (data, ack) in print("connected") let channel = self.echo.privateChannel(channel: "myChannel" channel.listen(event: "ChatMessage") { (data,ack) in print(data) } }) I successfully have logs that I m connected to channel and subscribed to my "ChatMessage" event, and also I receive messages from my chat(in Logs), but i can't get data from callback! idk why , but it s not working! plz help me! the code doesn't go inside the callback, I checked with debugger
i get the same issue . if you resolved . Please share solution with me Thank you so much.
I' m creating an Echo instance with params then a add echo.connected( callback: { (data, ack) in print("connected") let channel = self.echo.privateChannel(channel: "myChannel" channel.listen(event: "ChatMessage") { (data,ack) in print(data) } }) I successfully have logs that I m connected to channel and subscribed to my "ChatMessage" event, and also I receive messages from my chat(in Logs), but i can't get data from callback! idk why , but it s not working! plz help me! the code doesn't go inside the callback, I checked with debugger
When you instantiate Echo client you should obviously set some namespace. For example: let e : Echo = Echo(options: ["host":"http://localhost:6001", "auth": ["headers": ["Authorization": "Bearer " + token]], "namespace": "App//Events" ])
Same here, adding namespace not helping, I see in logs that room connected, events are Handling in Logs, but callback of .listen doesn't firing...
Update: Yeah for me after all was naming issue, eventFormatter from lib, was formatting a bit wrongly for my case, so if you have some problems with this look into eventFormatter inside lib!
Change namespace like @rutim7 will work fine . Thank you so much .
I' m creating an Echo instance with params then a add echo.connected( callback: { (data, ack) in print("connected") let channel = self.echo.privateChannel(channel: "myChannel" channel.listen(event: "ChatMessage") { (data,ack) in print(data) } }) I successfully have logs that I m connected to channel and subscribed to my "ChatMessage" event, and also I receive messages from my chat(in Logs), but i can't get data from callback! idk why , but it s not working! plz help me! the code doesn't go inside the callback, I checked with debugger