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

Use problem #9

Closed lavender2024 closed 4 years ago

lavender2024 commented 4 years ago

Dear Author: I found a few problems when using this project. 1.Unsubscribe without going through the protocol callback 2.Create a channel object multiple times, it will kill the app I am working on your demo.

FZambia commented 4 years ago

Hello, please provide steps and code to reproduce.

lavender2024 commented 4 years ago

Hello, please provide steps and code to reproduce.

https://github.com/rookieLeaves/socket_demo.git

3.Create a channel object multiple times, it will kill the app connect -> sub ->sub...
if print Can not create subscription: duplicateSub , you tap sub button ,app will have no response

FZambia commented 4 years ago

You need to handle duplicateSub exception in your code. Library allows to subscribe on the same channel only once.

Please give a more detailed description on each point - it will save a lot of my time to debug. Is your demo demonstrating problems? What should I do to reproduce them?

lavender2024 commented 4 years ago

Channel subscription I have done special processing, but I still have a problem, that is, unsubscribe without going through the protocol callback,but the subscription cancellation was successful.   The following methods do not go: func onUnsubscribe( s: CentrifugeSubscription, e: CentrifugeUnsubscribeEvent) { print("unsubscribed from channel", s.channel) }

puryagh commented 4 years ago

hi I fixed unsubscribe problem and new found bug on strong delegate of CentrifugeSubscriptionDelegate that causes client not deinited . you can download fixed package from https://github.com/puryagh/centrifuge-swift and use it 😇

FZambia commented 4 years ago

@puryagh thanks, I will give more attention to fixing these problems very soon

FZambia commented 4 years ago

Fixed unsubscribe problem and made pull request #10

FZambia commented 4 years ago

Should be fixed in v0.0.3