Hi,
Welcome to Microsoft Q&A!
Could you please tell us how do you create the single-instanced WinUI app? Whether you followed the Doc: Create a single-instanced WinUI app with C#
If so, you will define the DecideRedirection method
. In the DecideRedirection method you could call AppInstance.GetCurrent().GetActivatedEventArgs()
to get the current IActivatedEventArgs. And then you could get the url
via the ExtendedActivationKind.Protocol
.
AppActivationArguments args = AppInstance.GetCurrent().GetActivatedEventArgs();
ExtendedActivationKind kind = args.Kind;
switch (args.Kind)
{
case ExtendedActivationKind.Launch:
break;
case ExtendedActivationKind.ToastNotification:
break;
case ExtendedActivationKind.VoiceCommand:
break;
case ExtendedActivationKind.File:
break;
case ExtendedActivationKind.Protocol:
IProtocolActivatedEventArgs protocoldata = args.Data as IProtocolActivatedEventArgs;
Uri uri = protocoldata.Uri;
break;
case ExtendedActivationKind.StartupTask:
break;
default:
break;
}
Thank you.
Jeanine