【发布时间】:2014-07-08 20:57:55
【问题描述】:
我需要从推送器获取触发的事件,当应用程序进入后台时我没有得到它们(只有第一个)。
我有这个:
@property(strong, nonatomic) PTPusherPresenceChannel *taxi_channel;
PTPusherPresenceChannel *taxi = [PusherController sharedApp].taxi_channel;
- (void)viewDidLoad
@weakify(self);
[taxi bindToEventNamed:@"client-driver-cancel-service" handleWithBlock:^(PTPusherEvent *event)
{
DDLogDebug(@"%@: %@", event.name, event.data);
@strongify(self);
[self cancelServiceAcepted];
}];
问题是我在进入后台时得到一个事件,但在第一次之后我不再得到它们。
我已经在https://github.com/pusher/pusher-test-iOS/blob/master/Diagnostics/Code/ClientDisconnectionHandler.h实现了代码
如果应用程序进入前台,它可以正常工作。
【问题讨论】:
标签: ios7 background pusher