diff --git a/FayeObjc/FayeClient.h b/FayeObjc/FayeClient.h index 9e5e376..590834d 100644 --- a/FayeObjc/FayeClient.h +++ b/FayeObjc/FayeClient.h @@ -49,9 +49,11 @@ enum _fayeStates { @protocol FayeClientDelegate - (void)messageReceived:(NSDictionary *)messageDict; +- (void)socketDidSendMessage:(ZTWebSocket *)aWebSocket; - (void)connectedToServer; - (void)disconnectedFromServer; - (void)subscriptionFailedWithError:(NSString *)error; +- (void)subscribedToChannel:(NSString *)channel; @end diff --git a/FayeObjc/FayeClient.m b/FayeObjc/FayeClient.m index c88623d..bfc3693 100644 --- a/FayeObjc/FayeClient.m +++ b/FayeObjc/FayeClient.m @@ -134,10 +134,13 @@ [self handshake]; } --(void)webSocketDidSendMessage:(ZTWebSocket *)webSocket { +-(void)webSocketDidSendMessage:(ZTWebSocket *)aWebSocket { #ifdef DEBUG NSLog(@"WEBSOCKET DID SEND MESSAGE"); #endif + if(self.delegate != NULL && [self.delegate respondsToSelector:@selector(socketDidSendMessage:)]) { + [self.delegate socketDidSendMessage:aWebSocket]; + } } #pragma mark - @@ -309,6 +312,9 @@ } else if ([fm.channel isEqualToString:SUBSCRIBE_CHANNEL]) { if ([fm.successful boolValue]) { NSLog(@"SUBSCRIBED TO CHANNEL %@ ON FAYE", fm.subscription); + if(self.delegate != NULL && [self.delegate respondsToSelector:@selector(subscribedToChannel:)]) { + [self.delegate subscribedToChannel:fm.subscription]; + } } else { NSLog(@"ERROR SUBSCRIBING TO %@ WITH ERROR %@", fm.subscription, fm.error); if(self.delegate != NULL && [self.delegate respondsToSelector:@selector(subscriptionFailedWithError:)]) {