Open mrfarukturgut opened 3 years ago
Making SocketService
singleton fixed the issue. However I have faced some other issues when I just started to use the library, like it did not work at first when declared the instances in the init
. Moving the declarations to the class fixed it. It seems like some certain things breaks the library, or it is build that way i dont know, thus those stuff should be detected and mentioned in the docs to avoid further confusions.
Hi all. This is my socket service.
And a controller class
Above is working just fine. However I needed to make some changes to be able to use one socket appwide and decided to create and manage
SocketService
in another service calledChatService
With configuration, which I dont change anything in the
SocketService
, it was first keeping loopconnecting/connected/disconnected
. There are some similar issues opened and closed right now.I made some changes, which I dont remember exactly right now, and it now just
connecting/connected/disconnected
and stops. The first code config, creatingSocketService
instance in aController
and specifically starting it inviewWillAppear
works just fine.I was using
16.0.1
and saw in a similar issue that upgrading15.2.0
to16.0.0
resolved the problem. It did now work for me.