# Mobile Deeplinks

The "deep linking" in mobile apps is a technique for creating direct links to specific locations within an app. At Daxium, this feature was first used to describe actions behind app customisation widgets on iOS and Android.

It then became widespread for navigation in the Android v2 application and for communication with other mobile applications.

Such a deep link is a URI, (like a URL on the web) that begins with *daxium-air://* mobile applications.

## Principles

### Cross-app redirects

When an application calls a deep link, it goes into the background while the Daxium-Air application comes to the foreground. The calling application can be closed by the system at any time. Once the process in Daxium-Air is complete, the calling application can be recalled.

### Destinations

Deeplinks support multiple destinations, including home page, listing editor, listing view, sync page, and others.

Links may also open external applications or allow the user to log out of the Daxium-Air application.

### Limitations

There are some limitations and possible errors. If the user is not logged in, or does not have access to the specified form, a fatal error is displayed. Malformed paths or non-compliant field values produce warnings (see [Error handling](#error-handling) below).

## Usage

### Actions of an application customisation widget

These links can be used for the following destinations.

* The home page - `/app/home`
* The form editor - `/app/new_submission`
* The form view - `/app/my_submission`
* Sync - `/app/sync`
* The settings page - `/app/settings`
* The search page - `/app/search`
* The tasks page - `/app/my_tasks`
* The webview page (which opens an external URL) - `/app/webview`
* Redirection to an external application - `/app/external_app`

Note! When calling a deep link, if the destination is the same as the current one, nothing happens.

### Create a form with parameterized values

Undoubtedly the most interesting feature in the context of calling from a third-party application.This application could thus

* target a specific form to open
* [pre-fill](/user-documentation/build/building-forms/field-options/prefill.md) specific fields with values passed as parameters

Here, the form identifier is mandatory and the values of the optional elements (fields) can be added as parameters.

Once received, they are inserted into the newly created submission.

Link root path: \*daxium-air://editor/create/\<structure\_id>\*The structure\_id parameter (corresponds to the technical id of the form) is part of the path.If it is configured it directs to the correct form, otherwise, a selector is presented to the user who will have to make their choice among all the available forms.

Example

Such a deep link is a URI, formed as :

`daxium-air://editor/create/XXX?item1=value1&item2=value2`

Full example:

```
daxium-air://editor/create/137396?string=Hello, world&number=123.456&boolean=true&date=2023-08-23T13:00:52Z&email=bob@daxium.com&phone=+33612345678
```

### Field compatibility To date, the following fields are supported

* Text (without rich text option)
* Number
* Date
* Email
* Telephone
* Boolean

Each field value must conform to its expected typology and its associated format, otherwise it is not inserted.

Deep link settings take priority over defaults and pre-fill.

All other field types are ignored by this mechanism, but can be populated via the usual default values and user-defined pre-fill.

Note! This function is currently only available on the Daxium-Air Android V2 application

## Error handling

| Code            | Message                                                                     | Criticality |
| --------------- | --------------------------------------------------------------------------- | ----------- |
| `DAERR-DEL1001` | No user is connected to the Daxium-Air application.                         | 🔴 Fatal    |
| `DAERR-DEL1002` | You cannot create such data because you do not have the corresponding form. | 🔴 Fatal    |
| `DAERR-DEL1003` | You cannot create such data because the corresponding form is disabled.     | 🔴 Fatal    |
| `DAERR-DEL1004` | You cannot create such data because the form is not top level.              | 🔴 Fatal    |
| `DAERR-DEL1005` | The field named `structureFieldName` does not exist in the form.            | 🟡 Warning  |
| `DAERR-DEL1006` | Number field `structureFieldName` has an incorrect type in the form.        | 🟡 Warning  |
| `DAERR-DEL1007` | The value in field `structureFieldName` cannot be interpreted as a number.  | 🟡 Warning  |
| `DAERR-DEL1008` | The value in field `structureFieldName` cannot be interpreted as a boolean. | 🟡 Warning  |
| `DAERR-DEL1009` | The value in field `structureFieldName` cannot be interpreted as a date.    | 🟡 Warning  |
| `DAERR-DEL1010` | The given path is unknown.                                                  | 🔴 Fatal    |
| `DAERR-DEL1011` | The value in the field cannot be interpreted as a duration.                 | 🟡 Warning  |
| `DAERR-DEL1012` | The field cannot be used here.                                              | 🟡 Warning  |

{% hint style="info" %}
As the journey through the Daxium-Air application via deep linking is limited to a single screen, once completed, the calling application will be returned to the user.
{% endhint %}

{% hint style="success" %}
Deep linking with Daxium-Air offers an efficient method to navigate and interact with the application, but it is important to respect its limitations and properly handle errors for an optimal user experience.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.center.daxium-air.com/user-documentation/build/building-apps/mobile-deeplinks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
