performFetchWithCompletionHandler给应用程序处理一切的时间有多少?

时间:2017-07-22 17:52:04

标签: ios background-fetch

我不明白,他们在performFetchWithCompletionHandler的文件中说:

https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623125-application

  

你的应用程序有多达30秒的挂钟时间来执行   下载操作并调用指定的完成处理程序块

但在代码中我喜欢这个

performFetchWithCompletionHandler 
  beginBackgroundTaskWithExpirationHandler
  sleep 4 min
  Logn(...)
  CompletionHandler
  endBackgroundTask
  Logn(...)  

它的工作正常!该应用程序仍处于活动状态(总共4分钟),我可以在监视器中看到日志...我只是有几次拨打ExpirationHandlerbeginBackgroundTaskWithExpirationHandler,但它&#39 ; s无论应用还活着还是工作

我错过了什么?那么我们有多少时间处理一切?

0 个答案:

没有答案