简体   繁体   中英

Is background sync in iOS without your app being launched possible?

I have an app in which i download some data periodically (i currently use nstimer). Is it possible to do this periodically in iOS without launching my app?

In some very specific cases, it's possible. The very specific case I'm talking about is if it's a magazine or newspaper app. This lets you use NewsstandKit to download new issues in the background so that the user can get the new edition without having to wait for a download.

No, its not possible. You can't treat apps like services.

The only way to do this is when the app is up and running.

Some apps may be allowed to execute stuff while they are in background (the user launched it and then pressed the home button, for example), but they have to be set like audio apps, for ie, in the info.plist you add this:

<key>UIBackgroundModes</key><array><string>audio</string></array>

and make sure the audioSession is active (playing a song, for ie). Anyways, I do not recommend the before mentioned method. I'd go the classic way, running the download on a background thread.

No it is not possible. The application needs to be launched.

No, it's not possible. iOS doesn't allow developers to execute code in background (with some exceptions for VoIP, etc) or without launching your application.

Can I say that this is somewhat possible using iCloud? I haven't really done any iCloud-specific programming but I have some games where the saved games are sync automatically. I just need to load the said save game after starting the game.

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