Launch External Apps

The launcher is a feature in Wisej.NET Hybrid that enables applications to open a URI by the system. This functionality is particularly useful for deep linking into other applications' custom URI schemes.

Sample

Android

If you want to use deep links to open other Android apps you should define an intent filter in your app. This can be achieved by adding the following XML to the Platforms/Android/AndroidManifest.xml file:

<activity android:name="appName" android:exported="true">
    <intent-filter>
       <action android:name="android.intent.action.VIEW" />
       <category android:name="android.intent.category.DEFAULT" />
       <category android:name="android.intent.category.BROWSABLE" />
       <data android:scheme="lyft"/>
       <data android:scheme="fb"/>
       </intent-filter>
</activity>

The <data> elements are the URI schemes pre-registered with your app. You can't use schemes that aren't defined in the intent filter.

To make your app browsable from other apps declare a <data> element with the android:scheme attribute:

<data android:scheme="appName"/>

iOS / MacCatalyst

Apple requires that you define the schemes you want to use. Add the LSApplicationQueriesSchemes key and schemes to the Platforms/iOS/Info.plist and Platforms/MacCatalyst/Info.plist files:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>lyft</string>  
    <string>fb</string>
</array>

Usage (Wisej.NET Hybrid)

private void button1_Click(object sender, System.EventArgs e)
{
	if (Device.Launcher.CanOpen("lyft://"))
		Device.Launcher.Open("lyft://ridetype?id=lyft_line");
}

Further Reading

Last updated