Deep Linking
Overview
Deep links can be used in emails, external systems, or other apps to open an app on a specific view. This improves the usability of an app by reducing the number of steps to get to the right place in the app.
Limitations
When generating a deep link, parameters can only be of type
text
,boolean
,integer
ornumber.
See the Handling view parameters section below for handling more complex types.Users need to be enrolled in the target app.
The structure of a deep link is:
Deep links take a view path and, optionally, a number of parameters.
yourcontainerurlscheme
yourcontainerurlscheme
The URL scheme of the JourneyApps container downloaded from OXIDE our through the App Stores is
journeyapps
.
view
view
paramName
paramName
Substitute paramName
with the name of a parameter in your view. Additional view parameter-and-value pairs can be added, separated by a &
.
The following are reserved terms and should not be used as parameter names:
j, k, h, t, u, enroll, user, url, view
Basic Example
For example, a deep link to this job_details
view would be structured as
Basic deep link flow
Generating a deep link
Deep links for an app can be generated in an app by calling the navigate.getDeeplink()
function from a view's JS/TS or by constructing the URL manually. This latter approach is useful for generating deep links from external systems or from CloudCode tasks.
Example: Generate deep link in an app
Example: Generate deep link manually
Handling view parameters
When generating a deep link all parameters become strings. When opening the deep link, certain parameters are automatically cast to JourneyApps types - e.g. "true"/"false" strings are turned into booleans. This happens for the following types: text
, boolean
, number
, integer
.
Developer Recommendations
View-level access control
Access control, such as limiting access to a view to certain user roles only, should happen in the init()
function of a view, not in the navigation function that navigates to the view. This ensures that access control is being applied whether users navigate using in-app navigation or using deep links.
For example, the following is recommended:
And the following is not recommended:
Validation and error handling of view parameters
This should happen in the init()
function of a view i.e. after parameters have received their values. This should not happen in the transform-value
function.
Encode URL when generating a deep link from an external system
Deep links should be URL encoded. When generating a deep link from an external system (including CloudCode) this can be done using the URL( ) class since it handles encoding of slashes, spaces and other non browser-safe characters into a valid url.
navigate.getDeeplink()
has this built-inExample in CloudCode:
Last updated