Xamarin.Essentials: Launcher

The Launcher class enables an application to open a URI by the system. This is often used when deep linking into another application's custom URI schemes. If you are looking to open the browser to a website then you should refer to the Browser API.

Get started

To start using this API, read the getting started guide for Xamarin.Essentials to ensure the library is properly installed and set up in your projects.

Using Launcher

Add a reference to Xamarin.Essentials in your class:

using Xamarin.Essentials;

To use the Launcher functionality call the OpenAsync method and pass in a string or Uri to open. Optionally, the CanOpenAsync method can be used to check if the URI schema can be handled by an application on the device.

public class LauncherTest
    public async Task OpenRideShareAsync()
        var supportsUri = await Launcher.CanOpenAsync("lyft://");
        if (supportsUri)
            await Launcher.OpenAsync("lyft://ridetype?id=lyft_line");

Platform Differences

The Task returned from CanOpenAsync completes immediately.