Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol activation in Windows App SDK #10915

Open
MartinZikmund opened this issue Jan 8, 2023 · 4 comments
Open

Protocol activation in Windows App SDK #10915

MartinZikmund opened this issue Jan 8, 2023 · 4 comments
Assignees
Labels
area/winui Categorizes an issue or PR as relevant to WinUI difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/enhancement New feature or request project/navigation-lifecycle 🧬 Categorizes an issue or PR as relevant to the navigation and lifecycle (NavigationView, AppBar, ...) project/non-ui ⚙️ Categorizes an issue or PR as relevant to winrt (non-ui)

Comments

@MartinZikmund
Copy link
Member

MartinZikmund commented Jan 8, 2023

i was following this page https://platform.uno/docs/articles/features/protocol-activation.html so i can open my app from the browser until i reached to
protected override void OnActivated(IActivatedEventArgs e)
which uno tells me it doesn't exist when i try to build
image

when i try to get the arguments from OnLaunched it always turn out empty string
image

image

and i try to open the app like this from the browser with url cycoau:youtube and it does open but with empty arguments shouldn't it be youtube or i'm missundertanding something

Originally posted by @ahmed-abdelrazek in #10558

@MartinZikmund
Copy link
Member Author

The Windows App SDK approach to Protocol Activation is different from UWP, we will need to check how we can support this on our side as well.

@jeromelaban jeromelaban added kind/enhancement New feature or request project/non-ui ⚙️ Categorizes an issue or PR as relevant to winrt (non-ui) labels Jan 10, 2023
@ahmed-abdelrazek
Copy link

any news on this? @MartinZikmund @jeromelaban

@BertrandDeSaintBezier
Copy link

BertrandDeSaintBezier commented Jul 20, 2023

In the meantime, here's a functional workaround for this on WinAppSDK : #12933 (reply in thread)

GitHub
On Windows, I'm running into an issue where it seems like the OnLaunch() function always starts up a new instance of the application, with all variables reverting to their default values. In the fo...

@MartinZikmund MartinZikmund added project/navigation-lifecycle 🧬 Categorizes an issue or PR as relevant to the navigation and lifecycle (NavigationView, AppBar, ...) difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI area/winui Categorizes an issue or PR as relevant to WinUI labels Aug 23, 2023
@ahmed-abdelrazek
Copy link

ahmed-abdelrazek commented Jan 12, 2024

In the meantime, here's a functional workaround for this on WinAppSDK : #12933 (reply in thread)

GitHub**OnLaunch always starts a new instance of Uno ? · unoplatform/uno · Discussion #12933**On Windows, I'm running into an issue where it seems like the OnLaunch() function always starts up a new instance of the application, with all variables reverting to their default values. In the fo...

this anwser isn't applicable to the latest version any more but it got me to this
image

var activatedEventArgs = AppInstance.GetActivatedEventArgs();

if (activatedEventArgs.Kind == Windows.ApplicationModel.Activation.ActivationKind.Protocol)
{
    if (activatedEventArgs is Windows.ApplicationModel.Activation.ProtocolActivatedEventArgs protocolActivatedEventArgs)
    {
        argsString = protocolActivatedEventArgs.Uri.ToString();
    }
}

which gets me what i want on windows( for the WINUI3 app) when i enter the url in the browser didn't test anything else yet
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/winui Categorizes an issue or PR as relevant to WinUI difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/enhancement New feature or request project/navigation-lifecycle 🧬 Categorizes an issue or PR as relevant to the navigation and lifecycle (NavigationView, AppBar, ...) project/non-ui ⚙️ Categorizes an issue or PR as relevant to winrt (non-ui)
Projects
None yet
Development

No branches or pull requests

4 participants