Using custom URL schemes

Specifying a custom URLs allow an application to be woken up when a specific URL is selected on a device. For example, the custom URL could be a home URL of the application web page.

Creating the sample stacks

This lesson uses 2 stacks,

1. The "launchee" stack, which is launched by a custom URL

2. The "launcher" stack, which calls the URL causing the first stack to launch.

The "launchee" stack can also be launched by entering the URL in a web browser.

The Launcher Stack

The "launcher" stack consists of 3 buttons which launch various URLs. The custom URL of the "launchee" stack is "webme" and any URL beginning with that string will launch the app. The rest of the URL can contain arguments or extra information that can be used by the "launchee" stack.

The script of the top button is

on mouseUp
    launch url "webme://"
end mouseUp

The other also use the launch url command.

The Launchee Stack

This is the stack that is launched, it has a field to display the the URL that caused it to be launched and a button that uses the mobileGetLaunchURL function to display the URL.

The script of the button is

on mouseUp
    local tURL
    ## This function returns the URL that was used to launch the application.
    put mobileGetLaunchUrl() into tURL
    answer tURL with "Okay"
end mouseUp

The urlWakeUp message

The "launchee" stack also handles the urlWakeUp message. This message is sent to an app when it is launched via a custom URL, it has 1 parameter, wakeUpString, which is the URL that launched the app. The "launchee" stack handles this message in the card script.

on urlWakeUp pURL
    ## This message is received by the app when a custom url is used to launch the app
    put pURL into field "url"
end urlWakeUp

Setting the Custom URL

An app's custom url is specified the the iOS or Android pane of the Standalone Application Settings. In this example the custom URL we want to use is "webme".

Launching the app from the Launcher stack

Deploy both stacks to your simulator or device, open the "launcher" stack and click any of the buttons. The "launchee" stack will open and the URL you selected will be displayed in the field. If you click the "Get Launch URL" button and answer dialog will be shown displaying the URL.

Launching the app from a browser

Once the "launchee" app is on your device you can also launch it from a browser, by going to any URL that starts with the custom URL of the app.


Barry G. Sumpter

Is there a way for the launchee to send back a message to the Laucher with data or perhaps a "Successful" or "Unsuccessful" message directly?

Hanson Schmidt-Cornelius

Hi Barry,

I am not aware of a way to implement this directly.

If the Launcher is still running as the main application, after the Launchee was called, then you may want to assume that the launch action was unsuccessful.

Alternatively, you could try this:

Using parameters you send to the Launchee as part of the URL to control its behaviour, it should be possible for the Launchee to launch the Launcher again. This would indicate that the Launchee is accessible and was lunched. In this case the Launcher and the Launchee would have to be registered with individual custom URLs. Don't think this is the most elegant approach though, as the user would see the launches of the applications.

Kind Regards,


Barry G. Sumpter

Hi Hanson,

Many thanks for the reply.

I've found the Laucher app is still in the process thead and can't be exited until after the launchee app has been exited.
I think thats an Android rule. Unless there is a special command in LiveCode so the laucher app can reliquish process control to the lauchee app.

I've setup a Path and File name parameter to send to the lauchee app. As to where to save any info I want to communicate between the two.

I've setup a timer in the Laucher app to check 10 times for the existance of that path and file name every 3 seconds.

Certainly not the most eligant approach either but works for me at the moment.

Hanson Schmidt-Cornelius

Hi Barry,

that is a very interesting approach and it saves you launching the launcher stack again. Would not have considered that.

LiveCode does not offer a command to relinquish control.

Kind Regards,


Devide colonnel

I got everything ordered ie my piece of hardware and smart phone with an on screen camera
That's proper on my desktop but i want a program that can define
my customized url and launch a few graphics before it manifests its proper domains

Elanor Buchanan

Hi Devide

You can define the Custom URL scheme for your app. The Custom URL can be used to launch your app and you set up the behavior of the app, so if you want to show graphics or a video on startup before the main app is show you can do that.

Kind regards


Graham Samuel

This is great stuff, and I see it will work well for two LC-originated apps.

I want my app to be able to launch an existing app, not one coded by me, and with no access to the source code. Is there a way to know what its Custom URL is? For example, my app could generate a file which I want to display in "Notes" on an iOS device. How can I launch "Notes" and pass it the file?

In the LC dictionary for "launch url", it says that if one tries to launch a file, then the default action for dealing with that file will open, and the calling app will be closed: but that's not what happens when one uses a custom URL. Also, at least on iOS systems, it's normal, when app A opens app B, to see a button at the top left of app B's screen to take the user back to app A. Not sure how all this fits together.

Panos Merakos

Hello Graham,

You need to know/find the custom URL of the app you want to launch. I did some research and found this list of custom urls of known iOS apps (have not tested if they are correct):

You also need to "whitelist" the custom URL(s) your app will launch, because they are blocked for security reasons otherwise. You can do so in the iOs standalone settings. This bug report has some useful info:

Kind regards,

Add your comment

E-Mail me when someone replies to this comment