mirror of
https://github.com/zhigang1992/FayeObjC.git
synced 2026-01-12 17:22:33 +08:00
@@ -49,9 +49,11 @@ enum _fayeStates {
|
||||
@protocol FayeClientDelegate <NSObject>
|
||||
|
||||
- (void)messageReceived:(NSDictionary *)messageDict;
|
||||
- (void)socketDidSendMessage:(ZTWebSocket *)aWebSocket;
|
||||
- (void)connectedToServer;
|
||||
- (void)disconnectedFromServer;
|
||||
- (void)subscriptionFailedWithError:(NSString *)error;
|
||||
- (void)subscribedToChannel:(NSString *)channel;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -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:)]) {
|
||||
|
||||
Reference in New Issue
Block a user