是否可以将推送通知中的参数发送给Toast(Windows Phone)? [英] Can I send parameters in push notifications to toast (Windows Phone)?
问题描述
我的应用程序中有一种情况,当应用程序处于脱机状态且显示为祝酒通知时,我需要向用户设备发送推送通知.
I have a case in my app where I need to send a push notification to a user device when the application is offline and appears as a toast notification.
当用户单击Toast消息时,我需要根据消息导航到应用程序中的特定页面.我知道这在Toast通知中可用,但是我可以将参数从服务器发送到Toast以确定页面吗?
I need when the user clicks on the toast message to navigate to a specific page in my application depending on the message. I know that this is available in toast notifications but can I send parameters from my server to the toast to determine the page?
推荐答案
当然可以.
您从服务器发送的Toast通知的XML如下所示:
The XML of the toast notification you send from your server looks like this:
<?xml version="1.0" encoding="utf-8"?>
<wp:Notification xmlns:wp="WPNotification">
<wp:Toast>
<wp:Text1>[string]</wp:Text1>
<wp:Text2>[string]</wp:Text2>
<wp:Param>[string]</wp:Param>
</wp:Toast>
</wp:Notification>;
您使用Param
参数将参数发送到您的应用程序:
You use the Param
parameter to send parameters to your app :
您可以使用Param元素深度链接到特定 应用中的屏幕.以下是允许的格式.用于的任何字符串 以下示例不得超过256个字符.
You can use the Param element to deep link to a specific screen in your app. Here are the allowed formats. Any string used for the following examples must be 256 characters or less.
- /page1.xaml –定义在应用启动时导航至应用中的屏幕.字符串必须以"/"开头.
- /page1.xaml?value1=1234& value2 = 9876 –定义导航至应用程序启动时的屏幕以及名称/值对信息. 字符串必须以"/"开头.
- ?value1 = 1234& value2 = 9876 –包含传递到应用程序默认启动屏幕的信息的名称/值对.字符串必须以 带有?".
- /page1.xaml – Defines the screen to navigate to in the app when the app starts. The string must begin with a "/".
- /page1.xaml?value1=1234 &value2=9876 – Defines the screen to navigate to when the app starts, along with name/value pairs of info. The string must begin with a "/".
- ?value1=1234 &value2=9876 – Contains name/value pairs of info passed to the default start screen of the app. The string must begin with a "?".
(摘自此处)
这篇关于是否可以将推送通知中的参数发送给Toast(Windows Phone)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!