I don't know if it's an issue... or a feature... but I'd like to know why in WebSocketTransport.send method, you call this:
if let handler = completionHandler { handler(nil, nil) }
When we invoke our method to subscribe to notifications, we receive a first callback with nil params (code above) and another one with the result from the server.
When we invoke our method to unsubscribe to notifications, the same callback (subscribe) is call again with handler(nil, nil). This time its the HubProxy->invoke(method: String?, withArgs args: [Any], completionHandler: ((Any?, Error?) -> ())?) method that call the first completionHandler with nil params.
hi FouZ. Yes I believe this is a feature. This code was based on DyKnow's SignalRObjC library and in both cases, nil was intended to be passed into the completion handler
I don't know if it's an issue... or a feature... but I'd like to know why in WebSocketTransport.send method, you call this:
if let handler = completionHandler { handler(nil, nil) }
When we invoke our method to subscribe to notifications, we receive a first callback with nil params (code above) and another one with the result from the server.
When we invoke our method to unsubscribe to notifications, the same callback (subscribe) is call again with handler(nil, nil). This time its the HubProxy->invoke(method: String?, withArgs args: [Any], completionHandler: ((Any?, Error?) -> ())?) method that call the first completionHandler with nil params.
Regards.