Answer the question
In order to leave comments, you need to log in
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.
// 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];
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question