I know this may seem a duplicate subject but its not (hopefully its not)
We have an application that uses GameCenter in the background for backend communication, up until ios8, GameCenter has ran in the background fine.
Now I need to find a fix around this, the key is that the app needs to constantly run in the background, it uses GameCenter chat server etc, so we have enabled Audio. I can't see us being able to use VOIP as an option (Apple would probably reject it)
I tried
[self performSelectorOnMainThread:@selector(keepAlive) withObject:nil waitUntilDone:YES];
[application setKeepAliveTimeout:600 handler: ^{
[self performSelectorOnMainThread:@selector(keepAlive) withObject:nil waitUntilDone:YES];
//[[GCHelper sharedInstance] applicationWentBackground];
}];
- (void)keepAlive {
self.bgTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
NSLog(@"Background handler called. Not running background tasks anymore.");
// [[UIApplication sharedApplication] endBackgroundTask:self.bgTask];
// self.bgTask = UIBackgroundTaskInvalid;
[self keepAlive];
}];
}
Which keeps it going for a bit, I guess the main question is, is it even possible now?
I have also followed this guide
http://blog.dkaminsky.info/2013/01/27/keep-your-ios-app-running-in-background-forever/