PushNotification 状态码 200 但未收到消息

发布于 2024-11-18 21:17:27 字数 185 浏览 4 评论 0原文

从推送客户端成功将 URI 发送到 Web 服务后,我使用 URI 从 Web 服务发送 Toast 通知,在 Web 服务中我得到的响应为:

推送状态 200, 通知状态:已收到, 设备连接状态:已连接, 通知通道状态:活动。

但推送客户端没有收到任何消息。今天早些时候,同样的场景曾经运行良好。谁能告诉我出了什么问题吗?

After successfully sent the URI to the web service from the push client, I send a toast notification from web service by using the URI, in web service I get the response as :

Push status 200,
NotificationStatus : Received,
DeviceConnectionStatus : Connected,
NotificationChannelStatus : Active.

But no message is received in the push client. The same scenario used to work fine earlier today. Can anyone tell me what is going wrong?

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

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

发布评论

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

评论(2

赢得她心 2024-11-25 21:17:27

您发送的消息是否相同(即相同)?我似乎记得一些格式错误的消息实例可以正常通过服务,但随后会在设备上被抑制。

您是否有代码来处理应用程序运行时到达的 toast 消息?如果这样做,请在其中放置一个断点,并在调试时向应用程序发送一个 toast,看看会出现什么结果。通过这种方式,您可以确保 Toast 已发送到设备,并查看内容是什么或可能存在什么问题。

channel.ShellToastNotificationReceived += channel_ShellToastNotificationReceived;

其中 channel 是您的通道对象,然后

void channel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
{
    Dispatcher.BeginInvoke(() => MessageBox.Show(e.Collection["wp:Text1"] + Environment.NewLine + e.Collection["wp:Text2"]));
}

或类似的操作将消息弹出到显示屏上。

Is the message you are sending the same (ie. identical)? I seem to remember that some instances of a malformed message would get through the service OK, but then be suppressed on the device.

Do you have code to handle toast messages that arrive while your app is running? If you do, put a breakpoint in there and send a toast to the app while you're debugging and see what comes out. In this way you can make sure that the toast is making it to the device, and also see what the content is or what the problem might be.

channel.ShellToastNotificationReceived += channel_ShellToastNotificationReceived;

where channel is your channel object, and then

void channel_ShellToastNotificationReceived(object sender, NotificationEventArgs e)
{
    Dispatcher.BeginInvoke(() => MessageBox.Show(e.Collection["wp:Text1"] + Environment.NewLine + e.Collection["wp:Text2"]));
}

or something similar to pop the message out to the display.

若有似无的小暗淡 2024-11-25 21:17:27

在Web服务中,如果设置了错误的setRequestProperty,例如设置了错误的X-WindowsPhone-Target和错误的X-NotificationClass,则Web服务将收到通知接收状态,但推送客户端将不会收到任何消息。

在我的例子中,我发送了一条 toast 消息,其中 X-WindowsPhone-Target 作为令牌,X-NotificationClass 作为 1。在给出正确的值后,它开始正常工作。

In web service, if a wrong setRequestProperty is set for example, setting wrong X-WindowsPhone-Target and wrong X-NotificationClass, then web service will receive notification received status, but the push client will not receive any message.

In my case I was sending a toast message with X-WindowsPhone-Target as token and X-NotificationClass as 1. After giving correct value it has started working fine.

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