Crate robius_open

Source
Expand description

A crate for opening URIs, e.g., URLs, tel:, mailto:, file://, etc.

Uri::new("tel:+61 123 456 789")
    .open()
    .expect("failed to open telephone URI");

Supports:

  • macOS (NSWorkspace)
  • Android (android/content/Intent)
  • Linux (xdg-open)
  • Windows (start)
  • iOS (UIApplication)

§Android

To use the library on Android, you must add the following to the app manifest:

<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
    tools:ignore="QueryAllPackagesPermission" />

<queries>
    <intent>
        <action android:name="android.intent.action.MAIN" />
    </intent>
</queries>

or alternatively, disable the android-result feature. However, disabling this feature will make Uri::open always return Ok, regardless of whether the URI was successfully opened.

Structs§

  • A uniform resource identifier.

Enums§

  • Errors encountered when opening a URI.

Type Aliases§