当我在后台状态下从推送器收到远程消息时如何启动应用程序

How to launch the app when I get Remote message from pusher in background state

这是我从推送器获取远程消息的代码。

self.pusher = [PTPusher pusherWithKey:@"pusherKey" delegate:self encrypted:YES cluster:@"ap2"];
PTPusherChannel *channel = [self.pusher subscribeToChannelNamed:@"my-channel"];

[channel bindToEventNamed:@"my-event" handleWithBlock:^(PTPusherEvent *channelEvent) {
    NSString *message = [channelEvent.data objectForKey:@"message"];
    }];

[self.pusher connect];

不,无法在后台自动启动应用程序。 可以执行一些短任务但不能启动应用程序。