gpt4 book ai didi

ios - 后台CLLocationManager在15分钟后停止更新

转载 作者:行者123 更新时间:2023-12-01 16:26:06 26 4
gpt4 key购买 nike

我已使用NSLocationAlwaysUsageDescription设置了info.plist,该应用程序在后台运行。大约15分钟后,它停止了。在“应用程序功能”部分启用了后台模式和位置​​服务

其他一切似乎都工作正常。

- (void)applicationDidEnterBackground:(UIApplication *)application {
NSLog(@"Entered Background");
self.appdelegatelocationManager = [[CLLocationManager alloc]init];
self.appdelegatelocationManager.delegate = self;
[self.appdelegatelocationManager setDesiredAccuracy:kCLLocationAccuracyBest];
[self.appdelegatelocationManager setDistanceFilter:kCLDistanceFilterNone];
[self.appdelegatelocationManager setPausesLocationUpdatesAutomatically:NO];
[self.appdelegatelocationManager startUpdatingLocation];

}

一旦我再次进入该应用程序并再次进入后台,它将再次工作15分钟。

请帮忙!

最佳答案

转到项目设置>后台模式下的目标,启用以下文件

1-位置更新
2-背景提取。 enter image description here

链接图像。

您的问题将得到解决。

关于ios - 后台CLLocationManager在15分钟后停止更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35283951/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com