0
/*Get the URI that the Microsoft Push Notification Service returns to the Push Client when creating a notification channel.
Normally, a web service would listen for URIs coming from the web client and maintain a list of URIs to send                
notifications out to. */

string subscriptionUri = TextBoxUri.Text.ToString();

MSDN上给出的描述中缺少有关 pushclient 如何将 URI 与 web 服务同步的更多信息。那么,有谁知道如何让我的应用程序使用 Windows Phone 的推送通知客户端将其 URI 发送到 MPNS,iso 必须手动将它们复制粘贴到我的 Web 应用程序中?格雷茨大奖赛

4

2 回答 2

1

请参阅 MSDN Windows Phone 代码示例,网址为:http: //msdn.microsoft.com/en-us/library/ff431744 (v=vs.92).aspx

'sdkToastNotificationCS' 示例中的以下代码片段显示了存储 uri 或发送到您的 web 服务的可能位置:

void PushChannel_ChannelUriUpdated(object sender, NotificationChannelUriEventArgs e)
    {

        Dispatcher.BeginInvoke(() =>
        {
            // Display the new URI for testing purposes.   Normally, the URI would be passed back to your web service at this point.
            System.Diagnostics.Debug.WriteLine(e.ChannelUri.ToString());
            MessageBox.Show(String.Format("Channel Uri is {0}",
                e.ChannelUri.ToString()));
            // Instead of showing the URI in a message box, POST to your web service

        });
    }

执行 HTTP POST 请求以发送 URI 和您推送用户的标识符。在您的 Web 服务上接收此 POST 数据并存储用户/URI,以便您可以从您的 Web 服务向该用户推送通知。

于 2012-02-28T18:21:18.243 回答
0

您只需要服务器上的一个端点,应用程序可以将 PNS uri(和任何其他相关信息)发送到该端点。

于 2012-02-02T01:34:34.503 回答