Skip to content

Instantly share code, notes, and snippets.

@devinfoley
Created November 18, 2011 22:34
Show Gist options
  • Save devinfoley/1377988 to your computer and use it in GitHub Desktop.
Save devinfoley/1377988 to your computer and use it in GitHub Desktop.
- (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