adamhartford / SwiftR

Swift client for SignalR (iOS and Mac)
MIT License
174 stars 74 forks source link

Signal Receive Data #67

Open AliYouness opened 7 years ago

AliYouness commented 7 years ago

Dear Adam

I encounter and strange issues. i could not get the Data send from server. swift R connected Successfully not not enter to broadcastMessage to get the data

I have used the below Code in swift

    SwiftR.useWKWebView = true
    SwiftR.signalRVersion = .v2_2_0
    //http://signalr.mobi-mind.mobi:8095
    //http://swiftr.azurewebsites.net
    //http://172.20.240.10:8101
    //92.42.51.219
    hubConnection = SwiftR.connect("http://172.20.240.10:8100") { [weak self] connection in
        self?.chatHub = connection.createHubProxy("MessagesHub")
        self?.chatHub?.on("broadcastMessage")
        {
            args in
            if let name = args?[0] as? String, message = args?[1] as? String, text = self?.textView.text {
                self?.textView.text = "\(text)\n\n\(name): \(message)"
            }
        }

    }

and the below in server ///Hub public void Send(string name, string message) { // Call the broadcastMessage method to update clients. Clients.All.broadcastMessage(name, message); }

please note the in fidler data is coming as expected