3

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>
Денис
  • 75
  • 5

1 Answers1

0

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.

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
  • but I do not need notifications, the user must follow the link, for example, from the letter and open it in the application – Денис Aug 06 '21 at 10:38
  • hi@Денис,May i ask in what scenario you have a problem? I posted the above link to show that Deeplink works properly on Huawei phones. – zhangxaochen Aug 06 '21 at 10:46
  • I received an email containing a link. when I click on this link, I want to choose to open it in the app or in the browser. But Huawei immediately opens it in the browser and does not offer to select an application. – Денис Aug 06 '21 at 11:11
  • @Денис The answer shows what is missing in your definition: the attribute `android:path="/deeplink"` – Robert Aug 06 '21 at 11:27