lukeredpath/libPusher — Issue #22: No Connection?
Author: jwhitehorn
Created: 2012-02-03 15:50:44+00:00
State: open

This is highly likely my own fault, but I did not know where else to post this question.

I was experiencing this issue with a build of libPusher from early January, and to just verify I am still having this same problem with a build from yesterday.

Essentially, it does not appear to be connecting or receiving any events.

I initialize PTPusher as follows:

client = [PTPusher pusherWithKey:@"API_KEY" delegate:self];

My class implements `PTPusherDelegate`, additionally I've provided implementations for:

- (void)pusher:(PTPusher *)client connectionDidConnect:(PTPusherConnection *)connection;
- (void)pusher:(PTPusher *)pusher connection:(PTPusherConnection *)connection failedWithError:(NSError *)error;

My implementation of each does nothing more than NSLog so I can see if it was even connecting.

Back in my code, right after I initialized PTPusher, I went on to wire up some event handlers:

channel = [client subscribeToChannelNamed:@"test"];
[channel bindToEventNamed:@"test" target:self action:@selector(honk:)];

[channel bindToEventNamed:@"test2" handleWithBlock:^(PTPusherEvent *event) {
NSLog(@"test2 received");
}];

The strange thing is that none of my NSLogs, event in the `connectionDidConnect` and `connection: failedWithError:` fire.

Am I correct in assuming that either `connectionDidConnect` or `connection: failedWithError:` should be firing (at the least)? It would seem that either I connected, or failed :-)