4

是否有任何代码可以说明 IFTTT 如何进行后台同步?

它基本上是一个地理定位黑客,但我想知道它到底是如何工作的。

4

1 回答 1

1

I'm not certain if this is what they're using, but you mentioned that it's a geolocation hack, and this Apple doc says (under "Implementing Long-Running Background Tasks") that you can add location to the UIBackgroundModes in an app's Info.plist to execute tasks in the background.

You'll need to go a bit beyond this to execute tasks even when the location hasn't changed -- see How do I get a background location update every n minutes in my iOS application? for how you could implement this, and iPhone - Backgrounding to poll for events for other methods of executing background tasks (in addition to using the geolocation hack).

于 2013-07-12T17:33:45.520 回答