iOS timed background processing

前端 未结 4 851
梦谈多话
梦谈多话 2020-12-03 17:59

I\'d like my app to be able to - say, every 12 hours - even if the app isn\'t curently running or is in the background, send an HTTP request to a server, get a small file wi

4条回答
  •  甜味超标
    2020-12-03 18:21

    I would add the voip background mode string in your Info.plist file. Then you can call setKeepAliveTimeout:handler: which allows you to periodically run a scheduled task. Keep in mind it will use more battery.

    More info: http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH5-SW15

提交回复
热议问题