English | 中文
App Linking allows links to work across platforms even on devices where your app is not installed. You can use these links to direct users to promotional information or native app content that they can share with others. You can create links of App Linking and send them to users, or allow users to share links dynamically generated in your app. Anyone who receives a link can tap it to access the linked content.
- A computer with HUAWEI DevEco installed for app development
- A device or emulator running HarmonyOS 2.0 or later
Before running the App Linking quickstart app, you need to:
- If you do not have a HUAWEI Developer account, register one and make it pass identity verification.
- Use your account to sign in to AppGallery Connect, create an app, and set Package type to APP (HarmonyOS app).
- Enable App Linking. For details, please refer to the App Linking development guide.
- Download the agconnect-services.json file from AppGallery Connect and copy it to the entry directory.
- Add a URL prefix when you create a link of App Linking. Copy the prefix and use it to replace the value of DOMAIN_URI_PREFIX in MainAbilitySlice.
Process the received links in the main entry of the app. Sample code: src\main\java\com\huawei\agc\quickstart\MainActivitySlice.java
If you have any questions about the sample code, try the following:
- Stack Overflow is a place for any programming questions. Be sure to tag your question with appgallery.
- Huawei Developer Forum AppGallery Module is great for general questions, or seeking recommendations and opinions.
If you run into a bug in our samples, please submit an issue to the Repository. Even better you can submit a Pull Request with a fix.
App Linking quickstart is licensed under the Apache License, version 2.0