Windows 应用程序中的推送通知 - 如何更改 Toast 消息的内容?
Push Notification in Windows App - How can I change the content of the Toast Message?
我有一个用 Cordova 开发的 Windows 应用程序。我用我的 Windows 开发者帐户注册了它并获得了我的令牌等。现在当我通过 Fiddler 向当前安装在 Windows Phone 上的应用程序发送推送消息(toast)时8.1,我收到关于 Phone 的通知就好了 - 但它只说 'New Notification'.
我用这个 xml 作为消息:
<?xml version="1.0" encoding="utf-8"?>
<wp:Notification xmlns:wp="WPNotification">
<wp:Toast>
<wp:Text1>Test Message</wp:Text1>
<wp:Text2>XXX</wp:Text2>
</wp:Toast>
</wp:Notification>
但是,Text1 和 Text2 都没有出现在我的通知中。
如何实现 toast 通知以实际使用推送通知中的内容?
因为我的应用程序是用 Angular JS 编写的,所以我不能使用任何关于该主题的 C# 文档。
如果您对此问题有任何帮助,我们将不胜感激。
提前致谢!
看起来您使用的是 MPNS 格式的 toast,但尝试使用 WNS 进行推送(我假设)。确保使用 WNS toast 格式,已记录 here。你的 toast 格式应该是这样的:
<toast>
<visual>
<binding template="ToastText02">
<text id="1">Test Message</text>
<text id="2">XXX</text>
</binding>
</visual>
</toast>
我有一个用 Cordova 开发的 Windows 应用程序。我用我的 Windows 开发者帐户注册了它并获得了我的令牌等。现在当我通过 Fiddler 向当前安装在 Windows Phone 上的应用程序发送推送消息(toast)时8.1,我收到关于 Phone 的通知就好了 - 但它只说 'New Notification'.
我用这个 xml 作为消息:
<?xml version="1.0" encoding="utf-8"?>
<wp:Notification xmlns:wp="WPNotification">
<wp:Toast>
<wp:Text1>Test Message</wp:Text1>
<wp:Text2>XXX</wp:Text2>
</wp:Toast>
</wp:Notification>
但是,Text1 和 Text2 都没有出现在我的通知中。 如何实现 toast 通知以实际使用推送通知中的内容?
因为我的应用程序是用 Angular JS 编写的,所以我不能使用任何关于该主题的 C# 文档。
如果您对此问题有任何帮助,我们将不胜感激。 提前致谢!
看起来您使用的是 MPNS 格式的 toast,但尝试使用 WNS 进行推送(我假设)。确保使用 WNS toast 格式,已记录 here。你的 toast 格式应该是这样的:
<toast>
<visual>
<binding template="ToastText02">
<text id="1">Test Message</text>
<text id="2">XXX</text>
</binding>
</visual>
</toast>