获取创建通知通道 Windows Phone 7 时 MPNS 返回给推送客户端的 URI

发布于 2025-01-01 11:49:47 字数 597 浏览 1 评论 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。 那么,有谁知道如何让我的应用程序使用 Windows Phone 的推送通知客户端将其 URI 发送到 MPNS,iso 必须手动将它们复制粘贴到我的 Web 应用程序中? 格雷兹大奖赛

/*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();

Further information on how the pushclient would then sync the URI with a webservice lacks in the description given on MSDN.
So, does anyone know how to make my app send its URI to the MPNS using the push notification client of the Windows Phone, iso having to manually copy-paste them into my web application?
Greetz GP

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏了南城 2025-01-08 11:49:47

请参阅 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 服务向该用户推送通知。

See MSDN Windows Phone Code Samples at:
http://msdn.microsoft.com/en-us/library/ff431744(v=vs.92).aspx

The following code snippet from the 'sdkToastNotificationCS' example show a possible location to store the uri or send to your webservice:

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

        });
    }

Execute an HTTP POST request to send the URI and an identifier for you push user. Receive this POST data on your web service and store the user/URI so you can push notifications to that user from your web service.

清引 2025-01-08 11:49:47

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

You just need an endpoint on your server that the app can send the PNS uri (and any other relevant information) to.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文