Register app for a URI association (Windows Phone 8.1 RT)

帅比萌擦擦* 提交于 2019-12-24 11:40:18

问题


Hello i want to create a scheme URI to launch my app from another app. I searched a lot, i found this tutorial URI associations, it shows how to register your app for A URI association but it is for Windows Phone 8. I am developing an app for Windows Phone 8.1 RT and none of the tutorials i found work. At least I'd like to know if it is supported on WP 8.1 RT.


回答1:


The term you're looking for is protocol activation. You can have a look at the official Association launching sample.

In short: you configure your protocol in your appxmanifest and handle activation in you App.xaml.cs code behind.

protected override void OnActivated(IActivatedEventArgs args)
{
    if (args.Kind == ActivationKind.Protocol)
    {
        ProtocolActivatedEventArgs protocolArgs =
           args as ProtocolActivatedEventArgs;
        var rootFrame = new Frame();
        rootFrame.Navigate(typeof(BlogItems), args);
        Window.Current.Content = rootFrame;
    }
    Window.Current.Activate();
}


来源:https://stackoverflow.com/questions/32755910/register-app-for-a-uri-association-windows-phone-8-1-rt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!