Clicking Done on Embedded Website into Zapworks


#1

Hi there, Adam here.
I’m making a project using Zapworks and wish to embed a website into the app , I have managed to do this successfully and show the website as planned but I’m wondering if by any chance there’s a way / command to tell if the person has clicked the done button to signal close the website and go back to the app and if so what would that be if there’s no way to do this is there a workaround?. See once they click done I want to change to the next scene.


#2

Hi Adam,

There’s currently no callback for when the app returns from the launchUrl() function.

What you could do however, is create a boolean that stores whether the button that launches the URL has been tapped, and set it to true when the button is pressed (in the same location as your launchUrl() function). You’ll also want to call hide() on the main symbol at the same time.

In your main symbol you could then check whether the value of the boolean is true and if so, call display() on the second subsymbol. This check could be added to your tracking image’s seen event handler for example.

I’ve uploaded an example project that contains this functionality for you to refer to. In the example, the first scene will display a blue plane tracked to a target image, with a white button on the screen. When tapped, the white button launches a URL and hides the main symbol. In the target image’s seen event we check if the button was tapped and if it was, we display the second scene which contains a single red plane.

You can download the zpp from here.

Hope this helps.

Al the best,
Seb