We are working on an VoIP application, when my application goes background, I have been trying to use the setKeepAliveTimeout:handler: to keep the connection alive. As per the apple documentation, they asks to give minimum 600 seconds as timeout. Actually we are maintaining less timeout value, is it possible to handle with less time out?
And if the time out hits, how to use the handler to reset the timer or request more time so that I can keep my connection alway alive (to receive incoming calls)?
Here is what I am doing...
- (void)applicationDidEnterBackground:(UIApplication *)application
{
BOOL backgroundAccepted = [[UIApplication sharedApplication] setKeepAliveTimeout:600 handler:^{ [self backgroundHandler]; }];
if (backgroundAccepted)
{
NSLog(@"VOIP backgrounding accepted");
}
}
- (void)backgroundHandler {
NSLog(@"### -->VOIP backgrounding callback"); // What to do here to extend timeout?
}