gpt4 book ai didi

windows-phone-7 - 将 Toast 通知发送到正在运行的 WP7 应用程序的 Xml 问题

转载 作者:行者123 更新时间:2023-12-04 07:12:31 25 4
gpt4 key购买 nike

亲们, 我已经运行了 WP7 示例应用程序。我还有一个服务 (WCF) 和一个推送通知发送器 (WPF)。到目前为止,这看起来与 Microsoft 在 WP7 培训套件中设置的推送通知安排非常相似。当我启动应用程序然后退出应用程序返回主屏幕时,我能够成功发送 toast 通知 - 它出现在顶部,发出一点声音,显示正确的文本,并在您启动我的应用程序时启动我的应用程序点击它。

但是,当我在应用程序在前台运行时向我的应用程序发送完全相同的 shell toast 通知时,我收到一条错误消息,提示根 XML 节点存在无效字符。这个错误发生在 WP7 的深处,因为我的 toast 通知处理程序从未被调用,调试器无法向我显示生成错误的代码行。

我正在使用培训套件中 WP7 推送通知示例附带的 NotificationSenderUtility 来发送通知。

如果有人知道为什么会发生这种情况或我该如何解决它,我很想知道,因为我有一个演示,我将在星期六的代码营中进行演示,推送通知应该是演示的一部分:)

这是我得到的堆栈跟踪:

在 System.Xml.XmlTextReaderImpl.Throw(异常 e) 在 System.Xml.XmlTextReaderImpl.Throw(Int32 res, String resString, String[] args) 在 System.Xml.XmlTextReaderImpl.Throw(Int32 res, String resString) 在 System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() 在 System.Xml.XmlTextReaderImpl.ParseDocumentContent() 在 System.Xml.XmlTextReaderImpl.Read() 在 Microsoft.Phone.Notification.ShellObjectChannelInternals.ParseXMLToProperties(String xmlString,IDictionary`2& propertyBag) 在 Microsoft.Phone.Notification.ShellObjectChannelInternals.OnNotificationReceived(IntPtr blob,UInt32 blobSize) 在 Microsoft.Phone.Notification.ShellObjectChannelInternals.ChannelHandler(UInt32 事件类型、IntPtr blob1、UInt32 blobSize1、IntPtr blob2、UInt32 blobSize2) 在 Microsoft.Phone.Notification.HttpNotificationChannel.Dispatch(对象 threadContext) 在 System.Threading.ThreadPool.WorkItem.doWork(对象 o) 在 System.Threading.Timer.ring()


谢谢, 凯文

最佳答案

检查您在客户端和发件人上的代码是否符合最新文档。测试期间规范发生了变化。

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

How to: Set Up a Notification Channel for Windows Phone

您使用的培训套件中的工具/代码可能尚未达到规范。

关于windows-phone-7 - 将 Toast 通知发送到正在运行的 WP7 应用程序的 Xml 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4073728/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com