안녕 스피 새로운 두 번째 매개 변수를 얻을 수 어떤 문제도없이. 하지만 내 문제는, 허브 메서드 newVisitorNotification에 가입하는 것입니다. 신호 R - 목적 C와 나는이 [신호 R 라이브러리]를 사용하여 채팅 응용 프로그램 [1]</p> <p>연결할 때 성공적으로 호출 할 수 있어요을 개발하고</p> <p>IOS에
[chat on:@"newVisitorNotification" perform:self selector:@selector(responsenewVisitorNotification:)];
새로운 메시지가 responsenewVisitorNotification
로 데이터를 전송합니다 newVisitorNotification하기 위해 오는
2016-12-30 12:21:52.389411 Chat System[451:79343] CONNECTION: connection did receive data {
A = (
"6279b7ce-20bf-40f7-b8e8-8f987e209fbf",
baman26
);
H = ChatHub;
M = newVisitorNotification;
}
그러나이 메서드는 하나의 매개 변수 만받을 수 있습니다.
-(void) responsenewVisitorNotification:(NSString *) response {
NSLog(@"Inside response incomming chat");
NSLog(@"Response incomming Chat : %@", response);
}
사람은 responsenewVisitorNotification
내부의 두 번째 매개 변수를 얻을하는 데 도움이 있습니다.
여기
- (void) StartConnection {
self.CONNECTIONSTATUS = NO;
[self setHubEnvironmentURL];
hubConnection = [SRHubConnection connectionWithURLString:environmentURL];
chat = [hubConnection createHubProxy:@"chatHub"];
[chat on:@"serviceStatus" perform:self selector:@selector(getServiceStaus:)];
[chat on:@"newVisitorNotification" perform:self selector:@selector(responsenewVisitorNotification:)];
// Register for connection lifecycle events
[hubConnection setStarted:^{
NSLog(@"Connection Started ");
NSLog(@"**************************************************************************");
NSLog(@"****************************** Starting Invoke ***************************");
NSLog(@"**************************************************************************");
[self invokeIncommingChats:ProfileId Company:companyId Token:profileToken];
self.CONNECTIONSTATUS = YES;
}];
[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];
}
- (void)getServiceStaus:(NSString *)message {
NSLog(@"Service Status : %@", message);
}
-(void) responsenewVisitorNotification:(NSString *) response {
NSLog(@"Inside response incomming chat");
NSLog(@"Response incomming Chat : %@", response);
}
[1]: https://github.com/DyKnow/SignalR-ObjC