-1
我通过Azure通知中心向ASP.NET网站的UWP应用程序发出通知,但当我点击通知时,它会打开应用程序并在启动屏幕中暂停,然后立即关闭,我如何解决此问题?UWP中的Azure通知中心
我通过Azure通知中心向ASP.NET网站的UWP应用程序发出通知,但当我点击通知时,它会打开应用程序并在启动屏幕中暂停,然后立即关闭,我如何解决此问题?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();
}
}