使用推送通知服务以及WCF用于Windows应用商店

时间:2013-10-23 19:59:28

标签: wcf windows-8 push-notification windows-store-apps windows-store

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

1 个答案:

答案 0 :(得分:1)

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

  

Windows推送通知服务(WNS)支持第三方   开发人员从他们自己发送吐司,瓷砖,徽章和原始更新   云服务。这提供了一种提供新更新的机制   您的用户以节能和可靠的方式。

     

它涉及以下步骤:

- 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.