Skip to content

Frequently Asked Questions

Pawel Kadluczka edited this page Jul 17, 2020 · 9 revisions

How to create a hub proxy?

If you need to create hub proxies then it means that you are using the previous (non-ASP.NET Core) version of SignalR. The current (ASP.NET Core) and the previous (non-ASP.NET Core) versions of SignalR are not compatible and this client only support the ASP.NET Core version of SignalR. You need to find a client that supports the previous (non ASP.NET Core) version of SignalR.

How to use the client?

Detailed user's guides can be found here:

The connection is being closed immediately after opening

Make sure that you keep a reference to the HubConnection instance you created. If you don't the instance will be destroyed when it goes out of scope which closes the connection.

Does the client support automatic reconnection?

As of version 0.7.0 the client does support automatic reconnection. You can find all the details in the Automatic Reconnection in the Swift SignalR Client.

How to receive data in background?

iOS does not allow to keep connections open when the application is in the background. If you leave a connection open the OS will kill it. As a result it is not possible to keep an active SignalR connection when the application is in the background. You need stop the connection when the application is backgrounded and re-open when it is brought to the foreground. More details here.

How to receive JSON?

Ideally you should create an object that correspond to your JSON structure and the client will create an instance of this object based on the data received from the server. Alternatively, you can send JSON string from the server and receive it as a string on the client and handle deserialization yourself.

Code does not compile due to undefined symbol errors to zlib

You may need to add libz.tbd to the libraries your project is linked with (under Build Phases, Linked Frameworks and Libraries) if you see undefined symbol errors similar to ones reported in https://github.com/moozzyk/SignalR-Client-Swift/issues/42.

Clone this wiki locally