locked
Open a uri in Windows Store App

    Question

  • Hi,

    I'm trying to open an url froma Windows Store App using Windows.System.Launcher.LaunchUriAsync

    But it doesn't work, success always has a false and no uri is launched. I've tried it debugging, and also in Windows 8.1 and Windows RT devices.

                var uri = new Uri((string)sender, UriKind.Absolute);
               // Launch the URI
                var success = await Windows.System.Launcher.LaunchUriAsync(uri, options);

               if (success)
               {
                   // URI launched
               }
               else
               {
                   // URI launch failed
               }

    Is this method working? Is there another way to open an url from a Windows Store App.

    Thank you folks!

    Monday, February 10, 2014 10:24 PM

All replies

  • Windows.System.Launcher is the way to launch URIs and it works in general.

    You'll need to provide more information to diagnose your issue. What URI are you launching and where is it?

    See the remarks in the LaunchUriAsync(Uri, LauncherOptions) documentation for some likely scenarios where LaunchUriAsync will fail.

    --Rob

    Monday, February 10, 2014 10:37 PM
    Owner
  • Hi Rob,

    I'm trying to open an url ("http://www.foo.com"), and also the market ("ms-windows-store:PDP?PFN="). 

    Even copying the example of the msdn the function doesn't work.

    The difference with a "normal" project resides in that this is a Unity3D project embedded in a XAML/C# project. I'm using an event-delegate functions to launch the uri from the Unity3D code. The event fires perfectly, when debugging the event i can see the uri parameter that receives.

    Also, i have the internetClient capability enabled and tried to enable all the available capabilities, with no effect.

    Thanks!

    Tuesday, February 11, 2014 10:45 AM