Official Content

Open a given URL, using the appropriate application installed on the device.

Syntax

Interop.Open(<URL>)

The <URL> parameter is the URL that will be opened.

Type returned
None

Examples

Open a tweet URL directly from Twitter app

Event 'OpenTweetGenexus'
Composite
  &AppInstalled = Interop.CanOpen("twitter://user?screen_name=GeneXus")
  if &AppInstalled
   Interop.Open("twitter://user?screen_name=GeneXus")
  endif
EndComposite
EndEvent

The URL "twitter://user?screen_name=GeneXus" will be opened in the Twitter app.

Open another app from our own, or ask to install it

Event 'OpenAnotherApp'
Composite
  &AppId = 'com.genexus.genexusmeeting'
  &AppUrl = 'market://details?id='+&AppId.trim()
   Interop.Open(&AppUrl)
EndComposite
EndEvent

In this example, we want to call another application from our App. In this case, we are calling this app: https://play.google.com/store/apps/details?id=com.genexus.genexusmeeting. When we execute this, the Google Play will open with the option to either install this app or open it, if it´s already installed.

Make a phone call

Event &phone.Tap
    composite
        ....
        Interop.Open('tel:' + &phone)
    endcomposite
EndEvent

In this case, when the user taps on the &Phone variable, we want to do something else before dialing to that number. By this way, we are overlapping the Phone domain default behavior.

Availability

As from GeneXus X Evolution 3

Scope

Objects: Objects for Native Mobile applications development only in user events
Platforms:  Android and iOS

See also

Sample




Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant