PushNotification 状态码 200 但未收到消息
从推送客户端成功将 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您发送的消息是否相同(即相同)?我似乎记得一些格式错误的消息实例可以正常通过服务,但随后会在设备上被抑制。
您是否有代码来处理应用程序运行时到达的 toast 消息?如果这样做,请在其中放置一个断点,并在调试时向应用程序发送一个 toast,看看会出现什么结果。通过这种方式,您可以确保 Toast 已发送到设备,并查看内容是什么或可能存在什么问题。
其中
channel
是您的通道对象,然后或类似的操作将消息弹出到显示屏上。
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.
where
channel
is your channel object, and thenor something similar to pop the message out to the display.
在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.