iphone – 在iOS中以编程方式将用户带到后台刷新设置

在我的应用程序中,我正在检查是否启用了后台刷新设置.如果未启用,我希望该应用程序将打开“设置”选项并将用户带到“后台刷新”选项.

是否有可能以编程方式进行? 最佳答案 我想你想做那样的事情?

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.");
}
点赞