V
V
Vladislav Pavlenko2016-03-02 21:39:19
Objective-C
Vladislav Pavlenko, 2016-03-02 21:39:19

Who can help me figure out SignalR?

Hello!
There is a need to use SignalR. Looks like I found some tutorials. Connected, everything is ok. But here's what comes.
505e1951aefb424486a1c292aeb670bc.png

// Connect to the service
    SRHubConnection *hubConnection = [SRHubConnection connectionWithURLString:@"http://app.plugmee.com/signalr/"];
    
    [hubConnection addValue:[self.userDefaults objectForKey:@"login"] forHTTPHeaderField:@"User-Id"];
    
    // Register for connection lifecycle events
    [hubConnection setStarted:^{
        NSLog(@"Connection Started");
    }];
    
    [hubConnection setReceived:^(NSString *message) {
        NSLog(@"Connection Recieved Data: %@",message);
    }];
    
    [hubConnection setConnectionSlow:^{
        NSLog(@"Connection Slow");
    }];
    
    [hubConnection setReconnecting:^{
        NSLog(@"Connection Reconnecting");
    }];
    
    [hubConnection setReconnected:^{
        NSLog(@"Connection Reconnected");
    }];
    
    [hubConnection setClosed:^{
        NSLog(@"Connection Closed");
    }];
    
    [hubConnection setError:^(NSError *error) {
        NSLog(@"Connection Error %@",error);
    }];
    
    // Start the connection
    [hubConnection start];

I am not asking you to solve my problem. I would be very grateful for an adequate tutorial (preferably in Russian, English is not very good, but it will do in English too).
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
German Polyansky, 2016-03-17
@pavlenkovs

Is there a problem with SRWebSocket too? It will be simpler, SignalR is based on it, configured in 3 lines, if there are problems through it, then the matter is in the server. I don't see any such errors.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question