<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: CN-gelivation</title>
    <description>The latest articles on DEV Community by CN-gelivation (@cn-gelivation).</description>
    <link>https://dev.to/cn-gelivation</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3263689%2F59112389-5046-49b7-984d-40829bc440e7.png</url>
      <title>DEV Community: CN-gelivation</title>
      <link>https://dev.to/cn-gelivation</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cn-gelivation"/>
    <language>en</language>
    <item>
      <title>Application Framework: Cross-App Navigation Practice in HarmonyOS</title>
      <dc:creator>CN-gelivation</dc:creator>
      <pubDate>Sat, 14 Jun 2025 01:17:17 +0000</pubDate>
      <link>https://dev.to/cn-gelivation/application-framework-cross-app-navigation-practice-in-harmonyos-1omn</link>
      <guid>https://dev.to/cn-gelivation/application-framework-cross-app-navigation-practice-in-harmonyos-1omn</guid>
      <description>&lt;h2&gt;
  
  
  Application Framework: Cross-App Navigation Practice
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Concept and Scenarios of Cross-App Navigation&lt;/li&gt;
&lt;li&gt;Typical Scenario Implementation: Social Sharing&lt;/li&gt;
&lt;li&gt;Typical Scenario Implementation: Ad Redirection&lt;/li&gt;
&lt;li&gt;Typical Scenario Implementation: Special Text Recognition&lt;/li&gt;
&lt;li&gt;Common Issues&lt;/li&gt;
&lt;li&gt;Summary&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Concept and Scenarios of Cross-App Navigation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Concept of Cross-App Navigation
&lt;/h3&gt;

&lt;p&gt;Cross-app navigation refers to the process of navigating from the currently used app (caller) to another app (target) for continued business operations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Caller and Target: In the app launch process, when app A launches app B, app A is the caller, and app B is the target.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { common } from '@kit.AbilityKit';

const link = 'https://appgallery.huawei.com/app/detail?id=com.huawei.hmsapp.books'

@Entry
@Component
struct Index {

  build() {
    Column() {
      Text('Caller')
      Button('Go to App Market').onClick(()=&amp;gt; {
        let context = getContext(this) as common.UIAbilityContext
        context.openLink(link)
      })
    }
    .height('100%')
    .width('100%')
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1qwr191jnrydkqd4haek.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1qwr191jnrydkqd4haek.gif" alt="Image" width="720" height="1280"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Cross-App Navigation in Daily Life
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Links shared in social media that direct to specific content pages in the original app.&lt;/li&gt;
&lt;li&gt;Video app splash screen ads that redirect to a specific product details page.&lt;/li&gt;
&lt;li&gt;Calendar invitation links that directly add events to the system calendar.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Typical Scenario 1: Social Sharing Redirection
&lt;/h4&gt;

&lt;p&gt;Share content links containing App Linking through the system share panel to friends, achieving a one-click direct access to the original content.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuhcdydrcg42kyhgopdxz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuhcdydrcg42kyhgopdxz.png" alt="Image" width="800" height="482"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Typical Scenario 2: Ad Redirection
&lt;/h4&gt;

&lt;p&gt;Use App Linking to accurately redirect from an advertisement link to a specific app page, increasing marketing conversion rates.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn1u2ldprv3mnb53whsto.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn1u2ldprv3mnb53whsto.png" alt="Image" width="800" height="735"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Typical Scenario 3: Special Text Recognition Redirection
&lt;/h4&gt;

&lt;p&gt;Utilize the system’s text recognition capabilities to identify special texts and directly redirect to functionality from text.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvenobyv9v42uwdad8hu4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvenobyv9v42uwdad8hu4.png" alt="Image" width="800" height="704"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Cross-App Navigation Implementation Plan
&lt;/h3&gt;

&lt;p&gt;Based on the determinability of the target app, cross-app navigation can be divided into two categories:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Launch a specific app: Directly navigate to a designated app and its specific page (e.g., app A redirects to product detail page in app B).&lt;/li&gt;
&lt;li&gt;Launch a specific type of app: Let the system recommend an app capable of carrying out a task based on the function intent, allowing the user to choose. For example, when navigating, the user can select any map app.&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;
  
  
  Launch a Specific App
&lt;/h4&gt;

&lt;p&gt;Launching a specific app refers to scenarios where the target app is explicitly specified for navigation. The system offers two main implementation methods:&lt;/p&gt;
&lt;h5&gt;
  
  
  1. App Linking (App Linking and Deep Linking)
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;App Linking: Achieves more secure and reliable navigation via domain verification and HTTPS protocols. When the target app is not installed, it can open a web page, providing a better user experience.&lt;/li&gt;
&lt;li&gt;Deep Linking: Easier to implement but carries the risk of being impersonated by malicious sources.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Compared to Deep Linking, App Linking has the following advantages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Security&lt;/strong&gt;: Ensures only legitimate apps are launched through end-to-cloud security authorization and domain validation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Direct Experience&lt;/strong&gt;: No secondary confirmation is needed, allowing a direct jump to a specific page in the app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Direct to App Market&lt;/strong&gt;: When the app is not installed, it can redirect to the app market's app detail page.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deferred Link&lt;/strong&gt;: Supports restoring the previous navigation intent after app installation.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv5sllsh96vd79fl0pvwj.png" alt="Image" width="800" height="220"&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;App Linking is more recommended.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;
  
  
  2. System App Redirection
&lt;/h5&gt;

&lt;p&gt;The system provides several capabilities and interfaces to allow developers to quickly implement redirection to system apps, such as settings, app market, wallet, phone, calendar, contacts, etc., while ensuring access security. Refer to "Launching System Apps" for details.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fru4fg17gw7bguznm7kr6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fru4fg17gw7bguznm7kr6.png" alt="Image" width="800" height="377"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Launch a Specific Type of App
&lt;/h4&gt;

&lt;p&gt;In some scenarios, developers wish to implement functionality based on user intent rather than a specific app, such as using any supported map app for navigation.&lt;/p&gt;

&lt;p&gt;In such cases, developers do not specify a specific app. Instead, the system queries all apps on the device that match the criteria, and the user selects which app to use for the task.&lt;/p&gt;


&lt;h3&gt;
  
  
  Typical Scenario Implementation: Social Sharing
&lt;/h3&gt;
&lt;h4&gt;
  
  
  Scenario Description
&lt;/h4&gt;
&lt;h5&gt;
  
  
  Scenario 1: Target App Installed
&lt;/h5&gt;

&lt;p&gt;When the user clicks a shared link, the system directly launches the target app and navigates to the content detail page without going through a browser, enabling one-click access and greatly enhancing convenience and conversion rates.&lt;/p&gt;
&lt;h5&gt;
  
  
  Scenario 2: Target App Not Installed, Direct to App Market Configured
&lt;/h5&gt;

&lt;p&gt;When the user hasn't installed the target app and the developer has configured the direct link to the app market, clicking the link will directly redirect to the app market's app detail page. After installation, the app will automatically navigate to the original shared content via deferred link functionality without the user needing to search or take further actions.&lt;/p&gt;
&lt;h5&gt;
  
  
  Scenario 3: Target App Not Installed, No Direct Link to App Market Configured (Has Web Page)
&lt;/h5&gt;

&lt;p&gt;When the user clicks the link, the system opens the web page in the browser, allowing the user to directly view the content. The web page may offer a “Download” button to guide the user to install the app for a better experience. After installation, the app can still use the deferred link to direct the user to the original content.&lt;/p&gt;
&lt;h4&gt;
  
  
  Overall Process
&lt;/h4&gt;

&lt;p&gt;The process is divided into two types of content: one for what the social app needs to do, and another for the behavior of the intermediate or system app. For example, if user A shares an article link on their social account, typically an app link, it will first be processed by the share panel, which sends it to a sharing app.&lt;/p&gt;

&lt;p&gt;In the case of user B, the shared link can be clicked within the sharing app. Depending on whether the social app is installed, if installed, it will directly jump to the article detail page. If not installed, the system will check for the API15 capability to offer a direct link to the app market. If configured, the app market detail page will open, and upon installation, the deferred link feature will bring the user to the original content.&lt;/p&gt;

&lt;p&gt;If not API15, the browser will open, showing the web content, and the user may be guided to download the app. This method still ensures that the user can be directed to the target page with a one-click solution upon first use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fysycbwnohks33x2dj3p1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fysycbwnohks33x2dj3p1.png" alt="Image" width="800" height="714"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Social Sharing Redirection Overview
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flsog1ez8crgkjjt5d9ud.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flsog1ez8crgkjjt5d9ud.png" alt="Image" width="800" height="312"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Configuring AppLinking Service -- Preparation
&lt;/h4&gt;
&lt;h5&gt;
  
  
  Prerequisites:
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;A server&lt;/li&gt;
&lt;li&gt;Domain name (recommended to file for record)&lt;/li&gt;
&lt;li&gt;SSL certificate, as AppLinking links only support http links&lt;/li&gt;
&lt;li&gt;Huawei account
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F41tmqbx269el08lbsb5y.png" alt="Image" width="800" height="250"&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h5&gt;
  
  
  Configuring AppLinking Service -- Server Configuration
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6i6rfhek8fg2eboo7l4i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6i6rfhek8fg2eboo7l4i.png" alt="Image" width="800" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a .well-known folder on your website&lt;/li&gt;
&lt;li&gt;In that folder, create an applinking.json file with the following content. The appIdentifier is the app’s APPID:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "applinking": {
        "apps": [
            {
                "appIdentifier": "appId" // Generated App ID during app creation
            }
        ]
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h5&gt;
  
  
  Creating an App Link
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmy8m6lzbuwk1ch2k4m0r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmy8m6lzbuwk1ch2k4m0r.png" alt="Image description" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h5&gt;
  
  
  Configuring AppLinking Service -- Creating the App
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3fjs5bkf9fj49fjkp4sg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3fjs5bkf9fj49fjkp4sg.png" alt="Image" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h5&gt;
  
  
  Configuring AppLinking Service -- Configuring module.json5
&lt;/h5&gt;

&lt;p&gt;If it’s a single HAP, the following must be configured under &lt;strong&gt;entry&lt;/strong&gt; in &lt;strong&gt;module.json5&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"skills": [
  {
    "entities": [
      "entity.system.home" // Required configuration
    ],
    "actions": [
      "action.system.home" // Required configuration
    ],
    "uris": [
      {
        "scheme": "https",
        "host": "",
        "path":"path1"
      }
    ],
    "domainVerify": true
  }
]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once configured, sometimes links don’t work because the URL hasn’t matched, so check the matching rules, especially for &lt;strong&gt;path&lt;/strong&gt; features.&lt;/p&gt;

&lt;h5&gt;
  
  
  Configuring AppLinking Service -- Generating Manual Signing Files
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcrkldh4j5jfuu2lr7ydr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcrkldh4j5jfuu2lr7ydr.png" alt="Image" width="800" height="318"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  Configuring AppLinking Service -- Verification
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Simply write the AppLinking URL in a memo and click to see if it launches. This is a quicker method than writing code.&lt;/li&gt;
&lt;li&gt;There are two more methods through code or commands, but these are easier to look up.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Integrating the Share Panel
&lt;/h4&gt;

&lt;p&gt;By integrating &lt;strong&gt;Share Kit&lt;/strong&gt; (sharing service), the share panel is used to share the AppLinking link to article details.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fme6z4zv1hao1w7ivlym5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fme6z4zv1hao1w7ivlym5.png" alt="Image" width="648" height="1284"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h5&gt;
  
  
  Target App Configuration Process -- Integrating the Share Panel
&lt;/h5&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { common } from '@kit.AbilityKit'
import { systemShare } from '@kit.ShareKit'
import { uniformTypeDescriptor } from '@kit.ArkData'

@Component
struct Detail {
  private async share() {
    let context = this.getUIContext().getHostContext() as common.UIAbilityContext
    //...
    let shareData: systemShare.SharedData = new systemShare.SharedData({
      utd: uniformTypeDescriptor.UniformDataType.HYPERLINK, // Set share data type as hyperlink
      content: `https//xxxxxxx?aid=aid`, // Share the AppLinking link
      //...
    })
    let controller: systemShare.ShareController = new systemShare.ShareController(shareData)
    controller.show(context, {    // Show share panel
      previewMode: systemShare.SharePreviewMode.DEFAULT,
      selectionMode: systemShare.SelectionMode.SINGLE
    })
    //...
  }

  build() {

  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  In-App Navigation Handling (Key Part)
&lt;/h4&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default class Go1Ability extends UIAbility {
  private uiContext: UIContext | undefined = undefined
  private mAid: string = ''

  /**
   * Parse parameters in the link
   * @param want
   * @returns
   */
  getAid(want: Want): string {
    let uri = want?.uri
    let aid: string = ''
    if (uri) {
      let urlObject = url.URL.parseURL(want?.uri)
      aid = urlObject.params.get('aid') as string
    }
    return aid
  }

  onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
    this.mAid = this.getAid(want)
  }

  onNewWant(want: Want, launchParam: AbilityConstant.LaunchParam): void {
    let aid: string = this.getAid(want)
    if (aid &amp;amp;&amp;amp; aid !== '') {
      // Redirect to the specified page
    }
  }

  onWindowStageCreate(windowStage: window.WindowStage): void {
    let pageUrl: string = 'pages/Index'
    if (this.mAid &amp;amp;&amp;amp; this.mAid !== '') {
      pageUrl = 'pages/Detail'
      AppStorage.setOrCreate('aid', this.mAid)
    }
    windowStage.loadContent(pageUrl) // Redirect to the target page
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In our AppLinking sharing to user B, once the app is opened, how do we parse the link and navigate to the corresponding detail page? We use &lt;strong&gt;getAid()&lt;/strong&gt; to parse the AppLinking link and the special identifier. With this identifier, we use the &lt;code&gt;onCreate&lt;/code&gt; or &lt;code&gt;onNewWant&lt;/code&gt; callback methods, and &lt;code&gt;onWindowStageCreate&lt;/code&gt; to determine the appropriate page to load.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Page Parsing Inside the App&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Component
struct Detail {
  @StorageProp('aid') aid: string = ''
  private article: Article | undefined // Get article unique identifier aid

  aboutToAppear(): void {
    if (this.aid &amp;amp;&amp;amp; this.aid !== '') {
      this.article = getArticlebyId(this.aid)
    } else {
    }
  }

  build() {

  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Configuring Direct App Market Redirection
&lt;/h4&gt;

&lt;p&gt;For API15 and above, the &lt;strong&gt;Direct to App Market&lt;/strong&gt; feature can be configured.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbrp4bvjy58ui0ciwyc88.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbrp4bvjy58ui0ciwyc88.png" alt="Image" width="800" height="368"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Using Deferred Links
&lt;/h4&gt;

&lt;p&gt;Use the deferredLink.popDeferredLink() interface to fetch the original AppLinking link and redirect to the corresponding content detail page.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aboutToAppear(): void {
    // Fetch the deferred link and navigate to the target page
    deferredLink.popDeferredLink().then((link: string)=&amp;gt; {
      if (link) {
        // Parse the link parameters
        let urlObject = url.URL.parseURL(link)
        let aid = urlObject.params.get('aid') as string
        // Redirect to the detail page
        this.getUIContext().getRouter().pushUrl({
          url: 'pages/Detail',
          params: {
            aid: aid
          }
        })
      }
    })
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://camo.githubusercontent.com/34191ce06d73249d0971242d791e2e83e9df144e2adac3b31943a2d261e571cd/68747470733a2f2f692d626c6f672e6373646e696d672e636e2f6469726563742f39653765653937303866323034656363393636636135383730376538323462372e676966" class="article-body-image-wrapper"&gt;&lt;img src="https://camo.githubusercontent.com/34191ce06d73249d0971242d791e2e83e9df144e2adac3b31943a2d261e571cd/68747470733a2f2f692d626c6f672e6373646e696d672e636e2f6469726563742f39653765653937303866323034656363393636636135383730376538323462372e676966" alt="Image" width="338" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Web Page Development and Deployment
&lt;/h4&gt;

&lt;p&gt;Ensuring consistency across multiple platforms&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxhnhyq2vswswfc6rdtkt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxhnhyq2vswswfc6rdtkt.png" alt="Image" width="800" height="310"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fihb9sff0hno3ydqkyj81.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fihb9sff0hno3ydqkyj81.png" alt="Image" width="800" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy3fu7rjx7ndowj7dmd64.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy3fu7rjx7ndowj7dmd64.png" alt="Image" width="800" height="395"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h3&gt;
  
  
  Ad Redirection
&lt;/h3&gt;

&lt;p&gt;Splash Ads =&amp;gt; Redirect to Detail Page&lt;br&gt;
Similar to the sharing process&lt;/p&gt;
&lt;h4&gt;
  
  
  Redirection Process
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo1g8mcc62wq6vsx1m6hk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo1g8mcc62wq6vsx1m6hk.png" alt="Image" width="800" height="359"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Special Text Recognition Redirection
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk82hfz8xgho2tyal4ytv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk82hfz8xgho2tyal4ytv.png" alt="Image" width="514" height="1016"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Activate the &lt;code&gt;enableDataDetector&lt;/code&gt; attribute on the Text component to automatically recognize and mark special texts like links, dates, phone numbers, addresses, emails, etc.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Text('Phone 19988888888')
        .enableDataDetector(true)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqhnuv39yxdbv02p7aerc.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqhnuv39yxdbv02p7aerc.gif" alt="Image" width="720" height="1568"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Common Issues
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;How to check if AppLinking is configured successfully on AGC?&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5y7s75fq5uwkw7k0rkel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5y7s75fq5uwkw7k0rkel.png" alt="Image" width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What to do if configuration fails?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, if the AppLinking status shows failure, it doesn’t necessarily mean an error in configuration. It may be correctly configured but AGC has not updated in time. You can delete and re-add the link to verify. If the issue persists, it could be a server configuration issue.&lt;/li&gt;
&lt;li&gt;AppLinking links only support HTTPS, so if it is HTTP, SSL certificates need to be applied.&lt;/li&gt;
&lt;li&gt;Ensure the configuration file is in the correct directory with proper access rights for external access.&lt;/li&gt;
&lt;li&gt;If none of the above works, it’s recommended to seek help from website operation and maintenance staff for further troubleshooting.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;AGC shows the link address is configured successfully, but when trying to use openLink() or other methods to launch the app, the app doesn’t open.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AGC configures AppLinking links with a "/" at the end. Check if the link in AGC has an extra "/".&lt;/li&gt;
&lt;li&gt;Check if the link in module.json5 matches the one configured in AGC.&lt;/li&gt;
&lt;li&gt;If the app hasn’t manually applied for a certificate for signing, developers should follow the procedure to manually apply for certificates and profiles for signing.&lt;/li&gt;
&lt;li&gt;The developer's network may have restrictions. Try using a different network.&lt;/li&gt;
&lt;li&gt;Incorrect configuration in module.json5.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Cross-app navigation scenarios&lt;/li&gt;
&lt;li&gt;Implementation plan for cross-app navigation&lt;/li&gt;
&lt;li&gt;Configuring App Linking&lt;/li&gt;
&lt;li&gt;How the caller passes parameters to the target app and how the target app receives them, and returns results to the caller&lt;/li&gt;
&lt;li&gt;Adapting link addresses in cases where the app is not installed while using App Linking&lt;/li&gt;
&lt;li&gt;Common issues&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;I am Gelivation, a knowledge conveyor.&lt;/p&gt;

&lt;p&gt;Live replay: &lt;a href="https://developer.huawei.com/consumer/cn/training/course/live/C301749001004116947" rel="noopener noreferrer"&gt;Application Navigation Technology and Best Practices - Zhao Yichun&lt;/a&gt;&lt;/p&gt;

</description>
      <category>harmonyos</category>
    </item>
    <item>
      <title>Nested Scroll Conflict in Scrollable Components in ArkTS</title>
      <dc:creator>CN-gelivation</dc:creator>
      <pubDate>Fri, 13 Jun 2025 11:47:58 +0000</pubDate>
      <link>https://dev.to/cn-gelivation/nested-scroll-conflict-in-scrollable-componentsin-arkts-3p2g</link>
      <guid>https://dev.to/cn-gelivation/nested-scroll-conflict-in-scrollable-componentsin-arkts-3p2g</guid>
      <description>&lt;h3&gt;
  
  
  Nested Scroll Conflict in Scrollable Components
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Scrollable Components:
&lt;/h4&gt;

&lt;p&gt;WaterFlow, List, Grid, Scroll, Swiper&lt;/p&gt;

&lt;h4&gt;
  
  
  Scene Description:
&lt;/h4&gt;

&lt;p&gt;When a Scroll component wraps a WaterFlow component:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scrolling Up:&lt;/strong&gt; If the WaterFlow component hasn't reached the top, the entire Scroll component scrolls first.&lt;/li&gt;
&lt;li&gt;When the WaterFlow reaches the top, the WaterFlow component starts scrolling internally.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scrolling Down:&lt;/strong&gt; If the WaterFlow component hasn’t reached the top, both the Scroll and WaterFlow components scroll smoothly down together.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Entry
@ComponentV2
struct Index {
  @Local dataArr: Array&amp;lt;string&amp;gt; = []; // Data source

  aboutToAppear(): void {
    for (let i = 0; i &amp;lt; 40; i++) {
      this.dataArr.push(`data_${i}`); // Adding data to the array
    }
  }

  build() {
    Column() {
      List() { // Outer scroll component
        ListItem() {
          Row()
            .width('100%')
            .height('30%')
            .backgroundColor(Color.Green)
        }

        ListItem() {
          List() { // Inner scroll component
            Repeat&amp;lt;string&amp;gt;(this.dataArr) // Looping through the data
              .each((ri: RepeatItem&amp;lt;string&amp;gt;) =&amp;gt; {
                ListItem() {
                  Text('each_' + ri.item).fontSize(30)
                }
              })
          }
          .height('100%')
          .width('100%')
        }
      }
      .height('100%')
      .width('100%')
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Component Tree&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftxy7c6rlhnud3zzye24a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftxy7c6rlhnud3zzye24a.png" alt="Component Tree" width="574" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Effect:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://camo.githubusercontent.com/1890ade7bf0757cbccfc8b2f3068357707069f5bca1a9d5384f8036a6e751270/68747470733a2f2f692d626c6f672e6373646e696d672e636e2f6469726563742f37666433616235663637323934396634396635653133383335363239303639332e676966" class="article-body-image-wrapper"&gt;&lt;img src="https://camo.githubusercontent.com/1890ade7bf0757cbccfc8b2f3068357707069f5bca1a9d5384f8036a6e751270/68747470733a2f2f692d626c6f672e6373646e696d672e636e2f6469726563742f37666433616235663637323934396634396635653133383335363239303639332e676966" alt="Image description" width="720" height="1584"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Solution:
&lt;/h4&gt;

&lt;p&gt;Setting the &lt;strong&gt;nestedScroll&lt;/strong&gt; mode for the WaterFlow component allows smooth scroll switching when it reaches the top.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Enum Value Name&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SELF_FIRST&lt;/td&gt;
&lt;td&gt;The component scrolls first. After it reaches the edge, the parent component scrolls. If the parent component has an edge effect, it triggers the parent's edge effect; otherwise, it triggers the child's edge effect.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PARENT_FIRST&lt;/td&gt;
&lt;td&gt;The parent component scrolls first. After the parent reaches the edge, the component itself scrolls. If the component reaches the edge, it triggers its own edge effect; otherwise, it triggers the parent's edge effect.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Core Code:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;List() {
  //...
}
.nestedScroll({
  scrollForward: NestedScrollMode.PARENT_FIRST, // Scroll Up
  scrollBackward: NestedScrollMode.SELF_FIRST // Scroll Down
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Full Code:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Using Repeat inside List container component
@Entry
@ComponentV2
  // It is recommended to use the V2 decorator
struct Index {
  @Local dataArr: Array&amp;lt;string&amp;gt; = []; // Data source

  aboutToAppear(): void {
    for (let i = 0; i &amp;lt; 40; i++) {
      this.dataArr.push(`data_${i}`); // Adding data to the array
    }
  }

  build() {
    Column() {
      List() { // Outer scroll component
        ListItem() {
          Row()
            .width('100%')
            .height('30%')
            .backgroundColor(Color.Green)
        }

        ListItem() {
          List() { // Inner scroll component
            Repeat&amp;lt;string&amp;gt;(this.dataArr)
              .each((ri: RepeatItem&amp;lt;string&amp;gt;) =&amp;gt; {
                ListItem() {
                  Text('each_' + ri.item).fontSize(30)
                }
              })
          }
          .nestedScroll({
            scrollForward: NestedScrollMode.PARENT_FIRST,
            scrollBackward: NestedScrollMode.SELF_FIRST
          })
          .height('100%')
          .width('100%')
        }
      }
      .nestedScroll({
        scrollForward: NestedScrollMode.PARENT_FIRST,
        scrollBackward: NestedScrollMode.SELF_FIRST
      })
      .height('100%')
      .width('100%')
    }
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Effect After Fix:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://camo.githubusercontent.com/48324d1ed97d5088070a5315fe60a9fb4a08b45d9154053da6afb0e8359bcced/68747470733a2f2f692d626c6f672e6373646e696d672e636e2f6469726563742f31323237366264306431383434363334393736323362356631653539343964392e676966" class="article-body-image-wrapper"&gt;&lt;img src="https://camo.githubusercontent.com/48324d1ed97d5088070a5315fe60a9fb4a08b45d9154053da6afb0e8359bcced/68747470733a2f2f692d626c6f672e6373646e696d672e636e2f6469726563742f31323237366264306431383434363334393736323362356631653539343964392e676966" alt="Image description" width="720" height="1584"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>harmonyos</category>
    </item>
  </channel>
</rss>
