簡體   English   中英

為什么應用會自動刷新背景?

[英]Why the app auto background refresh?

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)中為“背景模式”設置任何設置。

誰能回答這個,謝謝。

backgroundRefreshStatus屬性僅鏡像當前用戶的設備設置,並且與您設置的info.plist模式無關

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM