2 part question:
Cheers,
Matt English
Hi Matt,
We have updated the github link with information on how you can capture the url parameters from a custom app link. Here is the code snippet.
We will include this as an upcoming enhancement for the map tour template.
Thanks,
Loayeh
Is it possible to test this in AppStudio Player or from within Qt Creator? If so, how?
Matt, no it is not possible to test this within the player. You will need to have a built app installed on your device. You can install a built app and test the app's link by accessing the link from a browser. Doing this prompts you to launch the app.
I can, for example, write the app below, and give it an app link of applink1. When I build and install the app on my device, I can call it from a browser by visiting the link applink1://?latitude=40
import QtQuick 2.7
import ArcGIS.AppFramework 1.0
App {
id: app
width: 400
height: 640Text {
id: txt
text: "No parameter called latitude exists"
anchors.fill: parent
wrapMode: Text.WordWrap
font.pointSize: 24
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}onOpenUrl: {
var urlInfo = AppFramework.urlInfo(url);
var openParameters = urlInfo.queryParameters;if (openParameters.hasOwnProperty("latitude")) {
txt.text = "Latitude is " + openParameters.latitude;
}
}
}
As a follow-on to this, based on the queryParameters I'd like to bypass the landing page and open up a particular map tour from the gallery - there may be 10 tours in the gallery. What would the code look like to do this?
Thanks,
Matt
Hi,
Launching Map Tour at a specific page through a custom URL Scheme is supported since AppStudio 3.0 release.
You can check how to use it in this blog post. I hope it helps
Thanks,
Tina