Periodic background synchronization

后端 未结 2 1748
走了就别回头了
走了就别回头了 2020-12-30 10:40

Im quite new to iOS programming and now want to implement a periodic background synchronization to synchronize my server data with client data. What I want to achieve is com

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-30 11:15

    You can't. Apple doesn't allow 3rd party apps to have regular background time like that. You'll need to come up with another approach like implementing a silent push notification from your server when new content is available.

    As @ekscrypto points out in their comment, you can use Background fetch to load small amounts of data when the system decides to fetch it. However, you don't have any control over when that fetching takes place. Search on "Fetching Small Amounts of Content Opportunistically" in the Xcode help system for more information.

提交回复
热议问题