2016-03-01 95 views
0
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."); 
} 

並使用此代碼來檢查應用程序的狀態: 該應用程序送花兒給人進入UIBackgroundRefreshStatusAvailable,並在能力(和info.plist中)不設置任何的「背景模式」。爲什麼應用程序自動後臺刷新?

任何人都可以回答這個問題,謝謝。

回答

0

當前用戶的backgroundRefreshStatus屬性只鏡的設備設置,並獨立設置的Info.plist的模式

+0

我是上個月也沒有設置背景模式的相關信息都設置和info.plist中任何東西,工作正常,我不知道爲什麼。 – JNYJ

+0

我不明白你的問題是什麼。我回答爲什麼它進入1.如果 –

+0

對不起。嘗試重新闡明和澄清你的問題 –

相關問題