iOS Background Fetch mode can be used to schedule some operation in the future that doesn't actually fetch remote data?

时光怂恿深爱的人放手 提交于 2019-12-06 11:26:02

As I understand you can do everything that does not take too long, plus you don't get a guaranteed interval when you app will be woken up - you just can request a certain minimum wake interval, which will be treated as a suggestion by iOS.

The only catch is that apparently you have to create an NSURLSession and actually do a web request, upon which return you can do whatever you want. So, you can do a dummy request and forget about any data you get returned, or maybe even create a failing request, as you are not interested in any real request at all - although I'm not sure what Apple will do when you implement the latter ...

You can use repeatInterval property of localNotification

        localNotification.repeatInterval=NSWeekCalendarUnit;  

For daily basis you can use NSDayCalendarUnit

No there are not API which can wake app after some time interval. In back ground fetch mode application will wake up after you set minimum time. Application will wake up any time after minimum time interval might be after 5 min or 1 sec. and that will decide system on application usage. so we can not take this approach, if you willing to retrieve remote data compulsory after some time interval.this may help u.

http://www.doubleencore.com/2013/09/ios-7-background-fetch/

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!