4

我尝试了以下教程在 Windows Phone 7 中创建推送通知。

http://www.sgtconker.com/2010/03/article-windows-phone-7-push-notifications/

http://www.silverlightshow.net/items/Implementing-Push-Notifications-in-Windows-Phone-7.aspx

我可以在 WP7 模拟器中创建通道 uri 而不会出现任何错误。

但是,当我将推送通知从服务器发布到频道 uri 时。我只能收到 404 错误。

谁能给我一些帮助?

谢谢。

=====

更新 1(10 月 28 日):

非常感谢您的回答。

在我阅读了最新的资源和示例代码后,我刚刚成功地向 WP7 模拟器发送了推送通知。

WP7 中的频道设置部分在最新的 SDK 中没有太大变化。

我之前遇到的问题来自发件人的 POST 消息部分。

以下网站非常有用。

http://www.thisisfanzoo.com/Blog/JeffF/archive/2010/08/02/a-really-long-post-about-the-windows-phone-7-push.aspx

他展示了如何正确构建 POST 消息,这非常关键。

当 WP7 模拟器(手机)关闭一个多小时时,之前创建的频道 uri 也会过期。因此,我们需要跟踪频道 uri 并在服务器发生更改时更新它。

祝你今天过得愉快。

=====

更新 2(10 月 28 日):

我刚刚在 Linux 服务器中使用 cURL 创建了 POST 消息,并通过推送通知成功地将其传递到 WP7 模拟器。

文本编码如 ASCII-UTF-8 转换问题也已修复。

4

2 回答 2

2

There were some changes to notification handling through the ctp and beta as Matt advices.

I'd recommend checking out this documentation for an overview, detailed code samples and response codes.

Push Notifications for Windows Phone

How to: Set Up a Notification Channel for Windows Phone

How to: Send a Push Notification from a Web Service for Windows Phone

Also if you'd like to get some more overview I'd recommend checking out the Mix 10 and Tech Ed 2010 NA talks by Peter Torr. If you'd like points in the video to skip forward to I can get these.

于 2010-10-27T22:55:27.427 回答
1

您引用的文章非常古老,并且与工具的 Beta 和 CTP 版本有关。不幸的是,推送通知是一个在 RTM/RTW 之前发生了很大变化的领域。

在http://msdn.microsoft.com/en-us/library/ff402537(v=VS.92).aspx查看 MSDN 上的最新说明。我怀疑使用与当前工具匹配的指令会更好。

于 2010-10-27T14:03:37.943 回答