2013-11-01 37 views

回答

6

下面是代码做到这一点:

if ([[UIApplication sharedApplication] backgroundRefreshStatus] == UIBackgroundRefreshStatusAvailable) { 

    NSLog(@"Background fetch is available for the app."); 
}else if([[UIApplication sharedApplication] backgroundRefreshStatus] == UIBackgroundRefreshStatusDenied) 
{ 
    NSLog(@"Background fetch for this app or for the whole system is disabled."); 
}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."); 
} 
相关问题