UWP中的Azure通知中心
答
当我通知点击它会打开应用程序,并在启动画面暂停然后立即关闭
通常情况下,OnLaunched
是当UWP启动应用程序时调用并且这种方法是最初创建的。但是,如果您想通过烤面包启动应用程序ActivationKind
为ToastNotification
,则可能需要通过覆盖OnActivated
事件句柄来处理激活的事件。例如:
protected override void OnActivated(IActivatedEventArgs args)
{
if (args.Kind == ActivationKind.ToastNotification)
{
ProtocolActivatedEventArgs eventArgs = args as ProtocolActivatedEventArgs;
// TODO: Handle URI activation
// The received URI is eventArgs.Uri.AbsoluteUri
var rootFrame = CreateRootFrame();
rootFrame.Navigate(typeof(MainPage));
Window.Current.Activate();
}
}