2017-05-31 83 views
1

我的Windows Phone 8.1应用程序中存在一些实现推送通知的问题。我检索到的频道URI这样:WIndows Phone 8.1 WNS将数据从Toast传递到应用程序

var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); 
return channel.Uri; 

我能够吐司通知发送到我的设备,但我无法访问这个推送通知的任何信息,当我打开的应用程序。通常会有某种'启动参数'或类似的东西,但是当我通过点击吐司启动时,我没有发现任何东西。

我读了几个帖子里的人建议我重写App.OnLaunched(LaunchActivatedEventArgs),但是这也不管用。手动启动应用程序和通过点击推送通知启动应用程序之间的参数值没有变化。

我错过了一些明显的论点吗?

澄清:我可以看到在设备上接收我的推送通知,但我不能从推送通知数据传递到我的应用程序(在攻其启动我的应用程序的通知)。

XML内容我张贴发送推送通知是如下:

string xml = [email protected]" 
<toast> 
    <visual> 
     <binding template=""ToastText02""> 
      <text id=""1"">{pushNotification.Title}</text> 
      <text id=""2"">{pushNotification.Message}</text> 
     </binding> 
    </visual> 
</toast>"; 
+0

您作为敬酒的内容发送了什么内容?你可以在那里分享你的XML吗? –

+0

更新了Toast通知示例 – Falgantil

回答

1

你能尝试添加一个“启动”参数写入标签?您应该在LaunchActivatedEventArgs.Arguments内部看到它:

string xml = [email protected]" 
    <toast launch=""ActivatedByToast""> 
     <visual> 
      <binding template=""ToastText02""> 
       <text id=""1"">{pushNotification.Title}</text> 
       <text id=""2"">{pushNotification.Message}</text> 
      </binding> 
     </visual> 
    </toast>"; 
+0

没错!现在我终于在LaunchActivatedEventArgs参数的Arguments属性中获得了一些东西!谢谢 – Falgantil

相关问题