使用参数启动Cordova Windows应用程序

使用参数启动Cordova Windows应用程序,windows,cordova,launch,Windows,Cordova,Launch,我发现很难从另一个本机Windows应用程序启动Cordova Windows应用程序 使用协议调用,我将向Cordova Windows应用程序传递一些参数,以查看Cordova应用程序是否从Windows本机应用程序识别这些参数 是否可以将参数从本机Windows应用程序传递到Cordova应用程序,以便Cordova应用程序将参数标识为参数?在本机Windows 8应用商店应用程序中,我正在使用应用程序协议关联将参数从一个应用程序发送到另一个应用程序。像 在发件人应用程序中: 单击按钮上的

我发现很难从另一个本机Windows应用程序启动Cordova Windows应用程序

使用
协议调用
,我将向
Cordova Windows应用程序
传递一些参数,以查看Cordova应用程序是否从Windows本机应用程序识别这些参数


是否可以将参数从
本机Windows应用程序
传递到
Cordova应用程序
,以便
Cordova应用程序
将参数标识为参数?

在本机Windows 8应用商店应用程序中,我正在使用应用程序协议关联将参数从一个应用程序发送到另一个应用程序。像

在发件人应用程序中: 单击按钮上的mainpage.xaml.cs

var url = "apptest:?" + name;
Uri uri = new Uri(url);
await Launcher.LaunchUriAsync(uri);
接收到的应用程序中

Package.appxmanifest:
声明-->可用声明添加-->协议-->名称=apptest

app.xaml.cs

protected override void OnActivated(IActivatedEventArgs args)
    {

        if (args.Kind == ActivationKind.Protocol)
        {

            ProtocolActivatedEventArgs protocolArgs = args as ProtocolActivatedEventArgs;

            var rootFrame = new Frame();

            rootFrame.Navigate(typeof(MainPage), protocolArgs);

            Window.Current.Content = rootFrame;
        }
        Window.Current.Activate();
    }
protected override void OnNavigatedTo(NavigationEventArgs e)
    {

        ProtocolActivatedEventArgs pa = e.Parameter as ProtocolActivatedEventArgs;

        if(pa != null)enter code here
        {
            string qS = pa.Uri.Query;
            if (!string.IsNullOrEmpty(qS))
            {
                Txt_name.Text = qS;
            }
        }          

    }
mainpage.xaml.cs

protected override void OnActivated(IActivatedEventArgs args)
    {

        if (args.Kind == ActivationKind.Protocol)
        {

            ProtocolActivatedEventArgs protocolArgs = args as ProtocolActivatedEventArgs;

            var rootFrame = new Frame();

            rootFrame.Navigate(typeof(MainPage), protocolArgs);

            Window.Current.Content = rootFrame;
        }
        Window.Current.Activate();
    }
protected override void OnNavigatedTo(NavigationEventArgs e)
    {

        ProtocolActivatedEventArgs pa = e.Parameter as ProtocolActivatedEventArgs;

        if(pa != null)enter code here
        {
            string qS = pa.Uri.Query;
            if (!string.IsNullOrEmpty(qS))
            {
                Txt_name.Text = qS;
            }
        }          

    }
通过这种方式,我将从发件人应用程序获取数据


同样,从windows 10本机应用程序到cordova应用程序是否有接收数据的方法。很难找到解决办法。无法找到确切的代码。

欢迎使用SO。你能和我们分享一下你迄今为止的尝试吗?