Search code examples
androiddeep-linkinghuawei-mobile-serviceshuawei-developersandroid-deep-link

How to deep link on Huawei devices?


With this intent filter, devices with google services offer the option of opening a link in an application or in a browser. Huawei devices open directly in the browser.

How to make earn a deep link on Huawei?

<intent-filter>
        <action android:name="android.intent.action.VIEW" />
         <category android:name="android.intent.category.DEFAULT" />
         <category android:name="android.intent.category.BROWSABLE" />
         <!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
         <data android:scheme="http"
               android:host="www.example.com" />
     </intent-filter>

Solution

  • The code that you provided above can also be directly used on Huawei devices.

    You can also refer to huawei push kit:

    <activity android:name=".DeeplinkActivity">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data
                <!-- Customize the following information:-->
                android:host="com.huawei.codelabpush"
                android:path="/deeplink"
                android:scheme="pushscheme" />
        </intent-filter>
    </activity>
    

    For more details, check Docs link.