centrifugal / centrifuge-swift

Swift client SDK for bidirectional real-time communication with Centrifugo and Centrifuge-based server over WebSocket
MIT License
47 stars 41 forks source link

Delegate methods don't work #77

Closed Medef closed 1 year ago

Medef commented 1 year ago

Hi, I ran into a problem with how the delegate methods work. When I connect to the server, they don't work. I am immediately disconnected from the server without any logs. Perhaps I am doing something wrong, so please help with this problem. I will be grateful for the answer Code: Снимок экрана 2022-12-26 в 14 17 41 Снимок экрана 2022-12-26 в 14 17 57 Снимок экрана 2022-12-26 в 14 19 31

FZambia commented 1 year ago

Hello, it's impossible to help given this amount of information. Probably you will find the reason of disconnect in server logs. Also onDisconnected event should contain code and reason of disconnect – but I don't see it in the output you provided. I see you have disconnected line in the output - probably it comes from your disconnect function where you are printing client.state – so you manually call disconnect for some reason.

Medef commented 1 year ago

Hello, it's impossible to help given this amount of information. Probably you will find the reason of disconnect in server logs. Also onDisconnected event should contain code and reason of disconnect – but I don't see it in the output you provided. I see you have disconnected line in the output - probably it comes from your disconnect function where you are printing client.state – so you manually call disconnect for some reason.

I don't know what the reason is, but my implementation above didn't want to work and what surprised me the most was that the delegate methods were not called. So I rewrote my service and now everything works correctly, the delegates work. I don't even know what could be the problem Снимок экрана 2022-12-26 в 16 39 38

FZambia commented 1 year ago

Hm, strange - but happens :) Looks like we can close this issue?

Medef commented 1 year ago

Hm, strange - but happens :) Looks like we can close this issue?

Yep, i can close it, thanks :)