Deep links allow users to launch a Zappar experience without first having to scan a zapcode. Here's an example deep link:
Every zapcode has a deep link - when a user taps on a deep link they will be taken directly into the experience published to its corresponding zapcode. In the case that the user does not have the Zappar app installed on their device the following behavior occurs:
- If the device supports Zappar but it is not installed the user will be directed to their app store to install Zappar.
- If the device does not support Zappar a message will be displayed listing device compatibility.
Designer codes rely on the device's camera detecting the zapcode/target image to display content, therefore it is not recommended to deep link to a Designer experience.
Finding the Deep Link for a Code
A project's deep link can be retrieved from its Project Overview page.
In Studio, the
Z.device.deepLinkId()function returns the deep link ID of the experience currently running, without the
Linking Between Experiences
Deep links can be used to move between different Zappar experiences - just use the link in conjunction with the existing features and functions for launching web links (e.g.
When doing so it's recommended that the
https://zpr.link/ portion of the link is replaced with
zappar:// since this ensures that the app gracefully handles the transition to the new content.
falseargument needs to be passed for the deep link to work correctly. For the
falseargument should not be passed.
Much like with a web link, you can provide information into an experience by passing it as the query string of a deep link.
In the example above everything after the
? is the query string which can be accessed using the
queryStringParameter(...) functions within a ZapWorks Studio script node. The
ZID is a placeholder for the deep link of the target experience.
zappar:// prefix for the reasons mentioned in the section above.
ZID is again a placeholder for the deep link of the target experience.
Z.device.launchUrl("zappar://" + ZID + "?myname=" + encodeURIComponent("Zap Bot") + "&myfriend=" + encodeURIComponent("Mark") + "&myfriend=" + encodeURIComponent("Connell"));
Customizing Experiences By Launch Method
ZapWorks Studio experiences can customize their behavior based on the method the user took to launch the experience. The
Z.device.launchMethod() function returns different values for the various possibilities. For more information see the LaunchMethod enum reference page.
If an experience relies on tracking images or codes to function correctly, users that have entered such an experience by clicking on a deep link are unlikely to have the appropriate image. You may wish to use the
launchMethod functionality mentioned above to provide an experience without the tracking image requirement in such cases.