Skip to content

Instantly share code, notes, and snippets.

@Donohue
Last active December 17, 2015 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Donohue/5638790 to your computer and use it in GitHub Desktop.
Save Donohue/5638790 to your computer and use it in GitHub Desktop.
Register for VOIP keep alive handler
BOOL ret = [[UIApplication sharedApplication] setKeepAliveTimeout:600 handler:^(void) {
if (updating_location) {
[location_manager stopUpdatingLocation];
NSLog(@"Keep alive: Stopping location updates");
}
else {
[location_manager startUpdatingLocation];
NSLog(@"Keep alive: Starting location updates");
}
updating_location = !updating_location;
}];
if (ret) {
NSLog(@"Keep alive handler registered");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment