Windows Phone 8.1中URI方案中的URL编码问题

时间:2016-01-28 08:10:33

标签: xamarin windows-phone-8.1

我已在Windows Phone中实现了自定义协议URI方案,其中包含以下两种类型的网址:

scheme://open?url=http%3A%2F%2Fstackoverflow.com%2F%3Fparam1%3D1%26param2%3D2

scheme://open?url=http%3A%2F%2Fstackoverflow.com%2F&param1=1&param2=2

这两个URI在Windows Phone 8.1中的ActivatedEventArgs中都相同,并且在android / windows桌面应用程序上运行正常。在两种情况下都遵循URI参数:

scheme://open?url=http://stackoverflow.com/&param1=1&param2=2

以下是在URI浏览中调用的函数:

    protected override void OnActivated(IActivatedEventArgs args)
    {
        Frame rootFrame = Window.Current.Content as Frame;

        if (args.Kind == ActivationKind.Protocol)
        {
            var _args = args as ProtocolActivatedEventArgs;
            Uri uri = _args.Uri;//same uri in both cases
        }
        base.OnActivated(args);
    }

0 个答案:

没有答案