当我使用 PHP 服务时,Windows Phone 7 推送通知未显示在我的手机上

发布于 2024-11-25 13:34:12 字数 2070 浏览 1 评论 0原文

我的 php 服务有一些问题。我使用 php 向 MS 通知服务发送 Tile 更新和 Toast 更新请求。在响应第一个请求后,我有以下标头:

URL: http://db3.notify.live.net/throttledthirdparty/01.00/AAHFGdPCYDOUSbbzeTpjKOMZAgAAAAADAQAAAAQUZm52OjIzOEQ2NDJDRkI5MEVFMEQ

响应:

HTTP/1.1 200 OK
Cache-Control: private
Server: Microsoft-IIS/7.5
X-DeviceConnectionStatus: Connected
X-NotificationStatus: Received
X-SubscriptionStatus: Active 
X-MessageID: da8aa692-e9cd-682b-fe1c-22ffe7379414
ActivityId: cd9c8b0b-26db-4eac-835d-9f9505d7a381 
X-Server: DB3MPNSM016
X-AspNet-Version: 4.0.30319 
X-Powered-By: ASP.NET
Date: Wed, 20 Jul 2011 11:21:42 GMT
Content-Length: 0

Array ( [X-SubscriptionStatus] => Active [X-NotificationStatus] => Received [X-DeviceConnectionStatus] => Connected )

但在我的 WP7 应用程序中我什么也没有。当我再次尝试更新磁贴时:

URL: http://db3.notify.live.net/throttledthirdparty/01.00/AAHFGdPCYDOUSbbzeTpjKOMZAgAAAAADAQAAAAQUZm52OjIzOEQ2NDJDRkI5MEVFMEQ

响应:

HTTP/1.1 404 Not Found
Cache-Control: private
Content-Type: text/html
Server: Microsoft-IIS/7.5
X-DeviceConnectionStatus: Disconnected
X-NotificationStatus: Dropped 
X-SubscriptionStatus: Expired
X-MessageID: {B6AAC154-DA37-277F-14FE-9F76365ACDD1}
ActivityId: f6b6a06b-a836-449c-9c9b-dc3033850981
X-Server: DB3MPNSM033 
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 20 Jul 2011 11:29:34 GMT
Content-Length: 1245 

似乎在第一次请求后我的网址被删除了。

我的 WP7 应用程序没有任何问题,因为当我使用 WindowsService 时一切正常。

看来我的问题与问题[问题]类似: Windows Phone 7 推送通知未显示在我的手机上

I have some problems with my php service. I use php for send Tile update and Toast update requests to MS Notification Service. After first request in response I have following headers:

URL: http://db3.notify.live.net/throttledthirdparty/01.00/AAHFGdPCYDOUSbbzeTpjKOMZAgAAAAADAQAAAAQUZm52OjIzOEQ2NDJDRkI5MEVFMEQ

RESPONSE:

HTTP/1.1 200 OK
Cache-Control: private
Server: Microsoft-IIS/7.5
X-DeviceConnectionStatus: Connected
X-NotificationStatus: Received
X-SubscriptionStatus: Active 
X-MessageID: da8aa692-e9cd-682b-fe1c-22ffe7379414
ActivityId: cd9c8b0b-26db-4eac-835d-9f9505d7a381 
X-Server: DB3MPNSM016
X-AspNet-Version: 4.0.30319 
X-Powered-By: ASP.NET
Date: Wed, 20 Jul 2011 11:21:42 GMT
Content-Length: 0

Array ( [X-SubscriptionStatus] => Active [X-NotificationStatus] => Received [X-DeviceConnectionStatus] => Connected )

But in my WP7 app I have nothing. When I try update tile again:

URL: http://db3.notify.live.net/throttledthirdparty/01.00/AAHFGdPCYDOUSbbzeTpjKOMZAgAAAAADAQAAAAQUZm52OjIzOEQ2NDJDRkI5MEVFMEQ

RESPONSE:

HTTP/1.1 404 Not Found
Cache-Control: private
Content-Type: text/html
Server: Microsoft-IIS/7.5
X-DeviceConnectionStatus: Disconnected
X-NotificationStatus: Dropped 
X-SubscriptionStatus: Expired
X-MessageID: {B6AAC154-DA37-277F-14FE-9F76365ACDD1}
ActivityId: f6b6a06b-a836-449c-9c9b-dc3033850981
X-Server: DB3MPNSM033 
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed, 20 Jul 2011 11:29:34 GMT
Content-Length: 1245 

It seems that after first request my url was deleted.

I do not have any problems in my WP7 app because when I use WindowsService all works fine.

It seems that my problem similar to problem [question]: Windows Phone 7 Push Notifications Not Showing Up On My Phone

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

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

发布评论

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

评论(2

挽手叙旧 2024-12-02 13:34:12

仔细检查您的 XML。我对未封闭的标签有完全相同的行为。

Check your XML carefully. I have got exact same behavior with unclosed tag.

初心未许 2024-12-02 13:34:12

在浪费了一些时间尝试修复一个没有任何问题的 XML 之后(由于答案表明 404 错误代码是由无效的 XML 引起的),我觉得有必要分享我的发现。

第一次在通知中发送无效 XML 不会立即在响应中识别(即,即使通知不会到达设备,响应也将为 200/Received/Active/Connected)。

但是,下次您尝试向该通道发送通知时(无论它具有有效还是无效的 XML),您会发现该通道不再有效(即响应将是 404)。

由于先前发送的无效消息,该通道变得无效。

这意味着,如果您收到此错误,您必须首先获取新的通知渠道(通过启动您的应用程序,该应用程序应启动对 MPN 服务的订阅)。

只有这样,您才应该验证 XML 的正确性并尝试将通知发送到新通道。这次您将再次获得 200 状态,了解 XML 是否有效的唯一方法是检查通知是否到达设备。

After wasting some time trying to fix an XML that had nothing wrong in it (due to answers that suggested 404 error code is caused by invalid XML), I feel the need to share my findings.

Sending an invalid XML in a notification for the first time will not be immediately identified in the response (i.e. the response will be 200/Received/Active/Connected even though the notification won't reach the device).

However, the next time you try to send a notification to that channel (whether it has a valid or invalid XML), you'll find that the channel is no longer valid (i.e. the response will be 404).

The channel becomes invalid due to the previously sent invalid message.

Which means, if you get this error you have to first get a new notification channel (by launching your app, which should initiate a subscription to the MPN service).

Only then you should verify the correctness of your XML and try to send the notification to the new channel. This time you'll get a 200 status again, and the only way to know if the XML was valid is to check if the notification reached the device.

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