• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

How to use App Linking on non-Huawei phones?

Search This thread

devwithzachary

Inactive Recognized Developer
Oct 12, 2009
2,919
1,897
29
London
Huawei P40
Huawei’s App Linking allows for cross platform deep linking. How does this work on Non Huawei phones that don’t have HMS core installed? Lets take a look!

Lets start by testing App Linking on non-Huawei phones according to the information presented in the App Linking codelab.

I integrated App Linking into a demo app by following the instructions in the codelab, and set the link opening mode to AppGallery and the local app store respectively.

Setting the link opening mode to AppGallery:
Java:
AppLinking.Builder builder = new AppLinking.Builder()
        .setUriPrefix(DOMAIN_URI_PREFIX)
        .setDeepLink(Uri.parse(DEEP_LINK))
        .setAndroidLinkInfo(new AppLinking.AndroidLinkInfo
                .Builder()
                .setOpenType(AppGallery)
                .build())


Setting the link opening mode to the local app store:

Java:
AppLinking.Builder builder = new AppLinking.Builder()
        .setUriPrefix(DOMAIN_URI_PREFIX)
        .setDeepLink(Uri.parse(DEEP_LINK))
        .setAndroidLinkInfo(new AppLinking.AndroidLinkInfo
                .Builder()
                .setOpenType(LocalMarket)
                .build())

I then installed the demo app on two non-Huawei phones to test App Linking between Huawei phones and non-Huawei phones.


0*Nd9xGwTG1-Ht-_Sg.png

As shown using the second code snippet we can see that App Linking is fully supported without the need of HMS Core. If the app has been installed on the non-Huawei phone, the in-app page can be directly opened without any problems.

If the app has not been installed on the non-Huawei phone and the link opening mode is AppGallery, the link will redirect the user to AppGallery. If AppGallery has not been installed, it will redirect the user to the AppGallery website.

If the app has not been installed on the non-Huawei phone and the link opening mode is set to local app store, the link will redirect the user to the local app store selected by the user. (Some mobile phone manufacturers will forcibly redirect the user to their own app store.)