0

我想构建一个基于 WCF 服务和 Win8 作为表示层的应用程序。我将在应用程序中提供消息传递功能,因此任何用户都必须看到磁贴上的更新(当新消息到达时)。据我了解,我需要以某种方式使用“推送通知服务”机制来使用新到达的消息更新所有客户端的磁贴?应用程序将如何工作?它应该直接调用WCF服务,然后WCF服务应该调用推送通知服务,还是首先Win8调用通知服务调用WCF?有人可以澄清一下这些东西是如何相互交流的吗?也许我应该考虑 WCF Duplex 方法?是否可以使 WCF 服务也成为推送通知服务?

4

1 回答 1

1

您可以使用 Windows 推送通知服务 (WNS)。您的应用请求通知渠道。然后它将调用 WCF 服务将其发送到该通道。WCF 服务将向通知通道(这是一个 URI)发送一个 POST 请求,以通知应用程序。请求的数据是 XML 格式的(您可以在链接中阅读它)。

Windows 推送通知服务 (WNS) 使第三方开发人员能够从他们自己的云服务发送 toast、tile、badge 和原始更新。这提供了一种机制,以一种节能且可靠的方式向您的用户提供新的更新。

它涉及以下步骤:

- Your app sends a request for a push notification channel to the Notification
  Client Platform.
- The Notification Client Platform asks WNS to create a notification channel.
  This channel is returned to the calling device in the form of a Uniform
  Resource Identifier (URI).
- The notification channel URI is returned by Windows to your app.
- Your app sends the URI to your own cloud service. This callback mechanism is
  an interface between your own app and your own service. It is your
  responsibility to implement this callback with safe and secure web standards.
- When your cloud service has an update to send, it notifies WNS using the
  channel URI. This is done by issuing an HTTP POST request, including the 
  notification payload, over Secure Sockets Layer (SSL). This step requires 
  authentication.
- WNS receives the request and routes the notification to the appropriate
  device.
于 2013-10-23T20:30:47.937 回答