Skip to content

CustomURL or AppLink or Launch app from URL

Jayson Ward edited this page Mar 22, 2018 · 8 revisions

Apps communicate only indirectly with other apps on a device. You can also define a custom URL scheme so that apps can send information to your app using URLs. Also web pages that run on your device also can communicate with your apps indirectly using custom URLs.

Few Web URL schemes you are familiar with:

http://www.esri.com
https://www.esri.com
ftp://myftpserver.mydomain.com

How does a custom url scheme look like:

twitter://
ibooks://ansnbad67adadadad
com-company-quakes://

How to setup custom url scheme for your app with appstudio: This will help other apps to communicate with your app and pass appropriate data along.

  1. In App Settings, specify the custom url scheme:

  2. In your appinfo.json it will create an entry:

"urlScheme": "com-company-quakes"

###Support:

Platform HTML Link Between QML Apps
iOS Yes Yes
Android Yes Yes
MacOS Yes Yes
Win 64 Yes Yes
Win 32 Yes Yes
Linux Yes Yes

How to get the url parameters in the App?

AppStudio exposes parameters sent to the custom urlScheme conveniently in the OpenUrl signal available on the App object. Here is a snippet to help you get started:

App {
...
...
  onOpenUrl: {
        var urlInfo = AppFramework.urlInfo(url); //refer to AppFramework documentation for all properties
        var openParameters = urlInfo.queryParameters;

        if (openParameters.hasOwnProperty("latitude")) {
            //do something with openParameters.latitude
        }
      
    }
...
...
}