ios - 如何触发应用程序通过 REST 服务获取数据?

标签 ios rest mobile

我正在寻找一种方法来触发应用程序从远程 REST 服务获取数据。该方法不需要轮询。

iOS 推送通知似乎不是一个选项,因为它可以被用户停用。然而,我可能错了。

是否有完成这项工作的最佳实践?

最佳答案

实际上推送通知是可行的方法。

在 ios8 和更高版本上,推送通知默认启用,这正是您想要的原因。 您无法向用户显示某些内容(这意味着不会显示包含带有警报的 json 的推送),但您的应用正在获取有效负载,并且可以在收到推送后启动操作。

From the documentation :

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/

相关文章:

ios - 未捕获的异常 : CALayer position contains NaN when doing animation

ios - 在屏幕旋转之前自动布局约束不正确?

apache-flex - 在 ActionScript 3 中加密/解密图像

javascript - Canvas (fabricjs) 阻止网络浏览器在手机上缩放和移动

Python requests.post() 返回 None

javascript - jquery 手机 : Change textarea background after submit button has been pressed

ios - 使用 SwiftyJSON 从 JSON 读取数据时返回 Null

ios - 如何在 ARKit 中点击放置自定义对象(.scn)?

iphone - 如何异步同步 CoreData 和 REST Web 服务,同时正确地将任何 REST 错误传播到 UI

node.js - 位置运算符不适用于feathersjs查询更新