Skip to main content

openUrl

Description

Opens a URL with the system default handler — browser, phone, mail, and so on. It always launches an external application (LaunchMode.externalApplication).

Parameters

ParameterTypeDescription
urlStringURL or scheme to open (for example, tel:, mailto:, https://...)

Returns

Future<void>

Notes

  • When the launch fails, it does not throw an exception — it only writes an internal log entry. (This is the difference from openExternalBrowser.)
  • To check up front whether the launch is possible, use $app.canLaunchApp.

Example

// Place a call with the phone app
$app.openUrl("tel:0212345678");
  • $app.canLaunchApp(urlScheme, callback) — Checks first whether the launch is possible
  • $app.openExternalBrowser(url) — The version that throws an exception when the launch fails