简体   繁体   中英

Webview.reload in background Xcode 8.2 swift 3

Happy new year to all.

Is it possible to make a uiwebview.reload if my app is running in background? I have a Timer with interval 20 seconds an random number 0-N + function that make number = number + 20 . If number > random number then webview.reload . This works good on iOS 10.2 in simulator i press home button and lock. But it will not working on my device iPhone 6 iOS 10.2. Is it possible to make webview.reloading in background? Sorry my English is not good. In my project settings capability background is ON and I check background fetch

If you know background fetch, this is hard to debug on a device because you're not guaranteed it is called in the amount of time you specify.

setMinimumBackgroundFetchInterval means that it is not called in an interval which is smaller than the value you specified. But there's no setMaximumBackgroundFetchInterval. So if iOS decides to call your app just once a day or even just once a week. It won't be called more often regardless your minimumBackgroundFetchInterval. AFAIK iOS decides when to call performFetchWithCompletionHandler measured by the pattern when and how often the users start's the app.

Can you write same code to set fetch interval? And I will call my app every 0-10 minutes. The system send all apps down every 3 minutes if I make fetch interval 170 seconds? Will this working?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM