我正在寻找一种方法来触发应用程序从远程 REST 服务获取数据。该方法不需要轮询。
iOS 推送通知似乎不是一个选项,因为它可以被用户停用。然而,我可能错了。
是否有完成这项工作的最佳实践?
最佳答案
实际上推送通知是可行的方法。
在 ios8 和更高版本上,推送通知默认启用,这正是您想要的原因。 您无法向用户显示某些内容(这意味着不会显示包含带有警报的 json 的推送),但您的应用正在获取有效负载,并且可以在收到推送后启动操作。
A user’s notification settings control only whether the system displays local or remote notifications onscreen. Regardless of the notification settings, local and remote notifications are delivered to your app at the appropriate times.
关于ios - 如何触发应用程序通过 REST 服务获取数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35919129/