English | 中文
App Linking allows you to create cross-platform links that can work as defined regardless of whether your app has been installed by a user. When a user taps the link on an Android or iOS device, the user will be redirected to the specified in-app content. If a user taps the link in a browser, the user will be redirected to the same content of the web version.
- A computer with Android Studio installed for app development
- A device or an emulator in Android Studio running Android 4.2 or a later version
- Check whether you have a HUAWEI ID. If not, register one and pass identity verification.
- Use your account to sign in to AppGallery Connect, create an app, and set Package type to APK (Android app).
- Enable App Linking.
- Go to Project settings > General information, download the agconnect-services.json file, and copy this file to the app's module directory.
- Create a link prefix in App Linking and replace the value of DOMAIN_URI_PREFIX in MainActivity with this prefix.
Main entry of the app, which processes received links. Sample code: src\main\java\com\huawei\agc\quickstart\MainActivity.java
Redirection to the target page when a deep link is processed in the app. Sample code: src\main\java\com\huawei\agc\quickstart\DetailActivity.java
If you have any questions about the sample code, try the following:
- Visit Stack Overflow, submit your questions, and tag them with
appgallery
. Huawei experts will answer your questions. - Go to AppGallery in the HUAWEI Developer Forum and communicate with other developers.
If you encounter any issues when using the sample code, submit your issues or submit a pull request.
The sample code is licensed under the Apache License, version 2.0.