[英]Determine when a Windows 8 app is launched by Notification
I have notifications going to my application, I want to be able to take the user to that page in my application when they click on the notification or live tile (current displayed item). 我有通知进入我的应用程序,我希望能够在用户点击通知或实时图块(当前显示的项目)时将用户带到我的应用程序中的该页面。
Is there a way to determine what the tile data is when your app is launched from a Live Tile or Toast Notification? 从Live Tile或Toast Notification启动应用程序时,有没有办法确定平铺数据是什么?
Also, users have the ability to right click on a live tile and turn it off. 此外,用户还可以右键单击实时磁贴并将其关闭。 Is there a way to detect that so I can turn off sending them live tiles or does WNS handle that? 有没有办法检测到这一点,所以我可以关闭发送他们的实时瓷砖或WNS处理它?
Thanks! 谢谢!
Windows does not provide a way to determine the tile content when a user launches the app via a tile. 当用户通过磁贴启动应用时,Windows不提供确定磁贴内容的方法。 Per the UX guidelines launching from each of the following should have the corresponding behavior: 根据UX指南,从以下各项启动应具有相应的行为:
All three of types of activation will cause the OnActivated
event to be fired with the IActivatedEventArgs.Kind
parameter set to ActivationKind.Launch
. 所有三种类型的激活都将导致OnActivated
事件被触发,并将IActivatedEventArgs.Kind
参数设置为ActivationKind.Launch
。
For both secondary tile and toast activations, the app can provide an additional context in the LaunchActivatedEventArgs.Argument parameter. 对于辅助磁贴和Toast激活,应用程序可以在LaunchActivatedEventArgs.Argument参数中提供其他上下文。
For secondary tiles, the launch arguments parameter can be set upon creation of the tile via the SecondaryTile.Arguments
property. 对于辅助切片,可以在通过SecondaryTile.Arguments
属性创建切片时设置启动参数参数。
For toast notifications, the launch arguments parameter is set as an attribute in the toast notification XML: 对于Toast通知,launch arguments参数设置为Toast通知XML中的属性:
<toast launch="myLaunchContext">
...
</toast>
Lastly, apps should not need to check whether the tile has been turned on or off by the user. 最后,应用程序不需要检查用户是否已打开或关闭磁贴。 Windows and WNS will determine whether delivery is required. Windows和WNS将确定是否需要交付。 The user can turn the tile on/off while an app is not running, so the state saved by the app may be out of sync with the setting. 用户可以在应用未运行时打开/关闭磁贴,因此应用保存的状态可能与设置不同步。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.