加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

objective-c – IOS 7后台获取

发布时间:2020-12-16 07:06:27 所属栏目:百科 来源:网络整理
导读:我正在开发一个使用后台获取的应用程序. 我需要它每秒5秒在后台执行的功能,但是我在google中看到的代码,SO决定何时应该调用该函数. 我希望它每5秒执行一次这个函数. 我的代码在这里: - (BOOL)application:(UIApplication *)application didFinishLaunchingW
我正在开发一个使用后台获取的应用程序.

我需要它每秒5秒在后台执行的功能,但是我在google中看到的代码,SO决定何时应该调用该函数.

我希望它每5秒执行一次这个函数.

我的代码在这里:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.

[[UIApplication sharedApplication] setMinimumBackgroundFetchInterval:UIApplicationBackgroundFetchIntervalMinimum];
return YES;
}

解决方法

没有办法做到这一点. iOS负责决定何时最好为您的应用提供获取内容的机会:

At appropriate times,the system gives background execution time to the apps that support this background mode,launching the app directly into the background if needed.

(从docs起)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读