lukeredpath/libPusher — Issue #26: subscribing to multiple private channels simultaniously fails
Author: bkeepers
Created: 2012-02-27 21:55:19+00:00
State: open

We're trying to use libPusher in the [Gaug.es](http://gaug.es) iOS app and we're having problems subscribing to private channels. Here's essentially what we're doing:

```

PTPusher *client = [PTPusher pusherWithKey:@"887bd32ce6b7c2049e0b" delegate:self encrypted:YES];
client.authorizationURL = [NSURL URLWithString:@"https://secure.gaug.es/pusher/auth"];

for (Site *site in sites) {
NSString *name = [NSString stringWithFormat:@"private-%@", site.id];
if ([client channelNamed:name] == nil) {
PTPusherChannel *channel = [client subscribeToChannelNamed:name];

[channel bindToEventNamed:@"hit" handleWithBlock:^(PTPusherEvent *event) {
NSLog(@"Received event data: %@", event.data);
}];
}
}
```

When there is not latency, the authorization requests work fine (i.e. in development), but whenever there is any latency at all (hitting production, or a sleep of 0.1 seconds or more), only the first channel is authorized and subscribed. Are we dong something wrong, or is there something timing out in the operation somewhere?