Ios setKeepAliveTimeout在几个小时后突然停止
计划一个Ios setKeepAliveTimeout在几个小时后突然停止,ios,objective-c,voip,Ios,Objective C,Voip,计划一个setKeepAliveTimeout,用最少600秒的定时器,使我的应用程序在几个小时(6-7)内运行良好 我一直在测试的所有设备都会发生这种情况。 为什么会发生这种情况?您的问题是什么?为什么区块停止重新启动,我如何才能使其恢复? /////////// VOIP HANLDER - BEGIN /////////// BOOL handlerAccepted = [[UIApplication sharedApplication] setKeepAliveTimeout:k
setKeepAliveTimeout
,用最少600秒的定时器,使我的应用程序在几个小时(6-7)内运行良好
我一直在测试的所有设备都会发生这种情况。
为什么会发生这种情况?您的问题是什么?为什么区块停止重新启动,我如何才能使其恢复?
/////////// VOIP HANLDER - BEGIN ///////////
BOOL handlerAccepted = [[UIApplication sharedApplication] setKeepAliveTimeout:kINTERVAL_10_MINUTES handler:^{
CLLocation *currentLocation = [RegionMonitoringService sharedInstance].locationManager.location;
#ifdef DEBUG
NSString *locationDescription = [NSString stringWithFormat:@"VOIP Location: {%f, %f}, Time: %@",
currentLocation.coordinate.latitude, currentLocation.coordinate.longitude,
[currentLocation.timestamp description]];
NSLog(@"setKeepAliveTimeout, %@", locationDescription);
// GeneratePushNotification(locationDescription);
#endif
[[ServerApiManager sharedInstance] saveLocation:currentLocation];
// Register a geofence
[[RegionMonitoringService sharedInstance] startMonitoringForLocation:currentLocation];
}];
#ifdef DEBUG
NSLog(@"VOIP handler installed: %@", handlerAccepted?@"YES":@"NO");
#endif
/////////// VOIP HANLDER - END ///////////