Deep Links in Android: Getting Started | raywenderlich.com

In this tutorial you’ll learn how to use intent filters to create deep links in to your Android app.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/18330247-deep-links-in-android-getting-started

I’m fairly new to this, so please forgive my ignorance. I am running into a few errors I can’t seem to get pass with code that I’m not copying and pasting on your page. This is what I’m seeing:

class PromoActivity : AppCompatActivity() {
private lateinit var activityPromoBinding: ActivityPromoBinding

Error: Line (40, 23): Unresolved reference: AppCompatActivity

Would you be able to help me out here? I’m on the step where you’re explaining Getting Data from Incoming Intents, and haven’t been able to select the Claim Offer link when I run the code.

Thanks in advance,

Hi,

For the error on Unresolved reference, I would recommend you have a strong/active internet connection then download the project materials and open the starter project on Android Studio and let it download all dependencies for the errors to disappear. If you had already done this without failure make sure you have all the proper imports. For AppCompatActivity it is import androidx.appcompat.app.AppCompatActivity

For the Getting Data From Intents, after you complete the instructions in the section run this command:

adb shell am start -W -a android.intent.action.VIEW -d "https://www.raywenderlich.com/test?code=abcde"

This prompts a dialog and after you select the Claim Offer option you can be able to retrieve the data from the intents.

Let me know if this helps or incase you have follow-up questions.

Hi

We have a mobile web browser app and native app

I enabled deep links on the android app and now when I go to my web app and navigate to any menu option on the web app it is redirecting to the mobile app.

How to avoid this redirection?

Hi,

To avoid such issues, I would recommend having separate links for mobile-related deep likes eg:

You can append mobile:yoursite.com so that deep links can only be opened when the link has mobile and for your website you can continue using normal links.

Let me know if this helps.