Deep Linking
Last updated
Last updated
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
or number.
See the 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
The URL scheme of the JourneyApps container downloaded from OXIDE our through the App Stores is journeyapps
.
view
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
For example, a deep link to this job_details
view would be structured as
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.
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
.
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:
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.
navigate.getDeeplink()
has this built-in
Example in CloudCode:
This value corresponds to the URL scheme of the container. This is the standard way of opening containers (see the section).
In custom containers, the URL scheme is specified in the section when creating the container configuration.
The viewPath
value corresponds to the view path as defined in OXIDE. Also see .
Developers will need to handle more complex view parameter types, e.g. where a view parameter is a DB
object, or a date
. The attribute is available on a view parameter for this purpose. In addition, the attribute is available to improve link/deep link management throughout an app in the case where optional parameters are added to a view at a later stage.
Deep links should be URL encoded. When generating a deep link from an external system (including CloudCode) this can be done using the class since it handles encoding of slashes, spaces and other non browser-safe characters into a valid url.