4
在我的應用程序中,我檢查後臺刷新設置是否啓用。如果未啓用,我希望該應用將打開「設置」選項並將用戶帶到「後臺刷新」選項。 是否有可能以編程方式進行?在iOS中以編程方式將用戶置於後臺刷新設置
在我的應用程序中,我檢查後臺刷新設置是否啓用。如果未啓用,我希望該應用將打開「設置」選項並將用戶帶到「後臺刷新」選項。 是否有可能以編程方式進行?在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.");
}