0
votes

I have a UWP app service from which I need to launch the default browser application. I've followed the app service tutorial available here. From the AppService (which is a universal windows runtime component), I tried to open the browser using its URI scheme.

var uriBing = new Uri(@"http://www.bing.com");
await Windows.System.Launcher.LaunchUriAsync(uriBing);
returnData.Add("Status", "OK");

this call gives me error of A method was called at an unexpected time.

Now my question is: Is it possible to open UWP application using its URI scheme from out of process app service?

1
Do you have any updates for this thread? - Nico Zhu - MSFT
I am launching applications using desktop app bridge and AUMIDs. my goal is to open applications and execute app-specific functionality. any suggestions of yours is appreciated. Thanks for getting back :) - tahiat
If you have used desktop extension, you could call LaunchUriAsync in extension side. - Nico Zhu - MSFT

1 Answers

0
votes

Is it possible to open UWP application using its URI scheme from out of process app service?

I'm afraid, you can't call this method in the background. please refer LaunchUriAsync document. this API must be called from within an ASTA thread (also known as the UI thread).