1# (Optional) Using canOpenLink to Check Application Accessibility
2## When to Use
3Before starting application B, application A can call **canOpenLink** to check whether application B is accessible.
4## Constraints
5A maximum of 50 URL schemes can be configured in the [querySchemes](../quick-start/module-configuration-file.md) field in the **module.json5** file of the entry module.
6## Available APIs
7**canOpenLink** is provided by the [bundleManager](../reference/apis-ability-kit/js-apis-bundleManager.md#bundlemanagercanopenlink12) module to check whether a target application is accessible.
8
9For details about the matching rules, see [Matching Rules of Explicit Want and Implicit Want](explicit-implicit-want-mappings.md).
10
11## How to Develop
12### Procedure for the Caller Application
13
141. Configure the [querySchemes](../quick-start/module-configuration-file.md) field in the **module.json5** file of the entry module to declare the URL schemes.
15
16    A configuration example is as follows:
17    ```json
18    {
19      "module": {
20        //...
21        "querySchemes": [
22          "app1Scheme"
23        ]
24      }
25    }
26    ```
27
282. Import the **ohos.bundle.bundleManager** module.
293. Call **canOpenLink**.
30
31    The sample code is as follows:
32    ```ts
33    import { bundleManager } from '@kit.AbilityKit';
34    import { BusinessError } from '@kit.BasicServicesKit';
35    import { hilog } from '@kit.PerformanceAnalysisKit';
36    try {
37      let link = 'app1Scheme://test.example.com/home';
38      let canOpen = bundleManager.canOpenLink(link);
39      hilog.info(0x0000, 'testTag', 'canOpenLink successfully: %{public}s', JSON.stringify(canOpen));
40    } catch (err) {
41      let message = (err as BusinessError).message;
42      hilog.error(0x0000, 'testTag', 'canOpenLink failed: %{public}s', message);
43    }
44    ```
45
46### Procedure for the Target Application
47Configure the [uris](../quick-start/module-configuration-file.md#skills) field in the **module.json5** file.
48
49A configuration example is as follows:
50```json
51{
52  "module": {
53    //...
54    "abilities": [
55      {
56        //...
57        "skills": [
58          {
59            "uris": [
60              {
61                "scheme": "app1Scheme",
62                "host": "test.example.com",
63                "pathStartWith": "home"
64              }
65            ]
66          }
67        ]
68      }
69    ]
70  }
71}
72```
73