Skip to content

Instantly share code, notes, and snippets.

@devinfoley
Created November 18, 2011 22:34
- (void)pusher:(PTPusher *)pusher connectionDidConnect:(PTPusherConnection *)connection {
NSLog(@"PTPusher:connectionDidConnect %@", @"Connected");
if (user != NULL) {
NSString* channelName = [NSString stringWithFormat:@"user-%d", user.userId];
NSLog(@"Subscribing to %@", channelName);
PTPusherChannel* channel = [self.pusher channelNamed:channelName];
if (channel != NULL) {
[self.pusher unsubscribeFromChannel:channel];
}
[self.pusher subscribeToChannelNamed:channelName];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment