解决方法
Apps that regularly update their content by contacting a server can
register with the system and be launched periodically to retrieve that
content in the background. To register,include theUIBackgroundModes
key with thefetch
value in your app’sInfo.plist
file. Then,when
your app is launched,call thesetMinimumBackgroundFetchInterval:
method to determine how often it receives update messages. Finally,
you must also implement the
application:performFetchWithCompletionHandler:
method in your app
delegate.
在内部,application:performFetchWithCompletionHandler:
,在你必须调用completionHandler之前,总共需要30秒才能完成你需要做的事情.绝对建议尽快执行您的民意调查,并在完成执行后立即调用completionHandler.如果您未在指定的30秒内调用它,您的应用将暂停从后台获取.或者,如果您开始花费很长时间进行每次提取,那么您的应用将来获得后台提取的机会将会减少.
Apps that use push notifications to notify the user that new content
is available can fetch the content in the background. To support this
mode,include theUIBackgroundModes
key with theremote-notification
value in your app’sInfo.plist
file. You must also implement the
application:didReceiveRemoteNotification:fetchCompletionHandler:
method in your app delegate.