Indicates whether the device can open a specific URL.
Interop.CanOpen(<URL>)
Where:
<URL>
The <URL> parameter is the URL to verify. The method determines whether it can be opened or not.
Type Returned:
Boolean, indicating if the URL can be opened or not.
Objects: Objects for Native Mobile applications development only in user event
Generators: Android, Apple
Event 'OpenTweetGenexus'
Composite
&AppInstalled = Interop.CanOpen("twitter://user?screen_name=GeneXus")
if &AppInstalled
Interop.Open("twitter://user?screen_name=GeneXus")
endif
EndComposite
EndEventt
In this example, the URL "twitter://user?screen_name=GeneXus" will be opened only if the Twitter app is installed on the device.
Notes:
- On iOS, this method returns False unless the Application Queries Schemes property is set for the URL scheme.
-
On Android 11 and higher, this method may return False unless the URL scheme of the target application is explicitly declared in the AndroidManifest.xml file. This behavior is due to Android package visibility restrictions. For more details, see SAC #60919.
This KB provides an additional example of using Interop.CanOpen.
Interop external object
Interop.Open method