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

AndroidLauncher.LaunchUriAsync always returns false #17162

Open
daniel-lerch opened this issue Sep 29, 2024 · 0 comments
Open

AndroidLauncher.LaunchUriAsync always returns false #17162

daniel-lerch opened this issue Sep 29, 2024 · 0 comments

Comments

@daniel-lerch
Copy link
Contributor

Describe the bug

Avalonia's Launcher does not work on Android. It always returns false and does not open any URI.

To Reproduce

  1. Create an Avalonia application with Android as target platform in Visual Studio
  2. Add a button to MainView.axaml
  3. Add a click event listener which executes
private async void Button_Click(object? sender, Avalonia.Interactivity.RoutedEventArgs e)
{
    bool success = await TopLevel.GetTopLevel(this).Launcher.LaunchUriAsync(new Uri("https://github.com/"));
    Console.WriteLine($"LaunchUriAsync: {success}");
}
  1. Run your app and click the button
  2. You will see LaunchUriAsync: false in the logs, no browser will open

Expected behavior

The URL should be opened in the default browser and the method should return true. It should only return false, if there is no browser app installed on the device.

Avalonia version

11.1.3

OS

Android

Additional context

Android version: 14
Default browser: Google Chrome

I also tested with Avalonia 11.1.0 and 8742dbd but the problem is always the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants