launchURL

Opens an URL with the default URL handler of the front-end.

Syntax

ui.Interface.frontCall("standard", "launchURL",
  [ url [, mode ] ], [] )
  1. url - The URL to invoke.
  2. mode (optional) - front-end specific meaning (see below).

Usage (General)

The "launchURL" front call opens an URL with the default URL handler available on the front-end platform; This is typically the web browser for "HTTP:" URLs, or the mailer for "mailto:" URLs, but the corresponding application may also be dedicated to the type of object specified by the URL (for example, a mapping service or to initiate a phone call).

This front call is a powerful feature: Front-end applications can register themselves as URL handlers, so you can start applications on the front-end through the lauchurl front call.
Supported schemes depend on your system configuration.
Important: Some type of URLs are not supported by all front-end platforms. Make sure that you test all target front-ends when using a lauchurl front call.

The mode parameter is optional and is interpreted differently according to the front-end type:

  • With Genero Web Client (GWC), use "replace" for the mode parameter, if you want the current application in the browser window or tab to be replaced with the new URL, instead of launching a new browser window or tab. If it is not present, or if a value other than "replace" is specified, the Genero Web Client behaves like the Genero Desktop Client, opening the URL in a new browser window.
  • With Genero Mobile and Genero Desktop Client (GDC) front-ends, the mode parameter is ignored if specified.

Example

To invoke Google Play Store:

CALL ui.Interface.frontCall("standard", "launchURL",
 ["market://details?id=com.google.android.apps.currents"], [])
CALL ui.Interface.frontCall("standard", "launchURL",
 ["market://details?id=com.google.zxing.client.android"], [])

To open Google Maps:

CALL ui.Interface.frontCall("standard", "launchURL",
 ["geo:48.613363,7.711083?z=17"], [])

To open Google Street View:

CALL ui.Interface.frontCall("standard", "launchURL",
 ["google.streetview:cbll=48.613363,7.711083&cbp=1,0,,0,1.0&mz=17"], [])

To initiate a phone call:

CALL ui.Interface.frontCall("standard", "launchURL", ["tel:+336717623"], [])