Can push notifications be used to run code without notifying user?

后端 未结 4 1950
[愿得一人]
[愿得一人] 2020-12-11 05:58

I have an app which needs to communicate with a server (to refresh it\'s data) once every 24 hours. This needs to happen even if the app is not open, nor in the background.

4条回答
  •  醉话见心
    2020-12-11 06:28

    This is only possible if your application is a Newsstand App, if it is, you can send a push notification with content-available: true once every 24 hours.

    If it is not a newsstand app, you can instead use GPS fences to run code. It is allowed to let the user set up GPS fences if they want the app to update when the user comes close to an area (ie. their home / work). This will wake the app and you can run the background download then. Instapaper for example does this.

提交回复
热议问题