获取Apple Watch的服务器数据

问题描述:

我想知道如何设计依赖于从服务器获取最新提要的watchOS应用程序.您是否需要使用应用程序上下文,而只是让iPhone使用WatchConnectivity框架在后台将其推送,还是在Apple Watch本身上使用NSURLSession?请记住,这是供watchOS 2使用的.

I am wondering how to go about designing a watchOS app that depends on getting the latest feed from a server. Would you need to use application context and just have the iPhone push it over in the background using the WatchConnectivity framework or would you use NSURLSession on the Apple Watch itself? Keep in mind this is for watchOS 2.

您可以使用NSURLSession来处理您的请求.因此,您的请求将在您的监视中是本地的.但请注意,您的手表在那里可以向用户显示简单的内容.

You can use NSURLSession to handle your request. So your request would be native on your watchn. But note that your watch is there to show simple Content to the user.