首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在iOS中以编程方式将用户转到后台刷新设置

问在iOS中以编程方式将用户转到后台刷新设置
EN

Stack Overflow用户
提问于 2013-11-25 07:30:08
回答 1查看 952关注 0票数 4

在我的应用程序中,我正在检查背景刷新设置是否已启用。如果没有启用,我希望该应用程序将打开设置选项,并带用户到后台刷新选项。是否有可能以编程的方式进行?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-11-25 07:55:50

我猜你想做这样的事?

代码语言:javascript
复制
if ([[UIApplication sharedApplication] backgroundRefreshStatus] == UIBackgroundRefreshStatusAvailable) {

    NSLog(@"Background updates are available for the app.");
}else if([[UIApplication sharedApplication] backgroundRefreshStatus] == UIBackgroundRefreshStatusDenied)
{
    NSLog(@"The user explicitly disabled background behavior for this app or for the whole system.");
}else if([[UIApplication sharedApplication] backgroundRefreshStatus] == UIBackgroundRefreshStatusRestricted)
{
    NSLog(@"Background updates are unavailable and the user cannot enable them again. For example, this status can occur when parental controls are in effect for the current user.");
}
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20186923

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档