Deep Linking
Version and platform compatibility
Deep linking support was introduced in version 4.89.0 of the JourneyApps Runtime and version 1 of the JourneyApps Container.
Deep links are currently only supported in Android, iOS, Windows, and MacOS containers.
Currently, on Web containers, deep links can be generated and called, but the Web container cannot be opened using a deep link.
The "Deep linking" feature flag must be enabled.
@journeyapps/runtime-build
version 2.1.9 is required for TypeScript apps.
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
This value corresponds to the URL scheme of the container. This is the standard way of opening containers (see the Open other Containers section).
The URL scheme of the JourneyApps container downloaded from OXIDE our through the App Stores is
journeyapps
.In custom containers, the URL scheme is specified in the Enrollment section when creating the container configuration.
view
view
The viewPath
value corresponds to the view path as defined in OXIDE. Also see view.path.
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
.
Developers will need to handle more complex view parameter types, e.g. where a view parameter is a DB
object, or a date
. The transform-value
attribute is available on a view parameter for this purpose. In addition, the required
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.
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