Support for Android deep linking?

#1

Hi there! Thanks for making such an awesome product.

I’ve managed to get iOS Universal Links working with my Expo app in production and without Branch (it seems to work just fine even though it’s not really documented in Expo’s docs). I set up an AASA on my server, added my domain under the ios.associatedDomains in my app.json, and found that it “just works” if I use Linking.getInitialURL to capture the URL on app launch and Linking.addEventListener to capture the URL when the app is already running.

Now I’m trying to sort out if the same thing is possible on Android. Based on their documentation, it seems like all I’d need is the ability to customize the manifest.xml and add intent filters that indicate my app can handle e.g. a https link to mydomain.com. So it seems like Expo could trivially support this with an android.intentFilterDomains in the app.json that accepts an array of objects with scheme, host, and pathPrefix keys and uses that to generate the relevant section of the manifest.xml (though I may be missing complexity around the actual link handling – not sure what React Native already has built-in here).

Am I correct in assessing that this support does not exist today? Is this something you’d be open to adding? (I’d also be willing to implement and send a PR if you can point me to the right section of the codebase – I couldn’t actually track down where specifically the manifest.xml is generated, not sure if some of that is closed-source since it lives on your servers.)

1 Like
#2

Hi-

Did you read this section here?
https://docs.expo.io/versions/v27.0.0/expokit/advanced-expokit-topics.html#changing-the-deep-link-scheme

and this https://docs.expo.io/versions/v27.0.0/workflow/linking#in-a-standalone-app
?

I think the information on how to do what you’re trying to do might be there, but post again here if not.

Charlie

#3

Hi, thanks for the reply! I don’t think either of those are quite what I’m looking for.

  • First one is specific to after you’ve detached from Expo (I’m hoping not to have to detach just to customize the Android manifest.xml, though you’re right that it’d be trivial if I detached)

  • Second one is helpful for using a custom scheme (like myapp://some/path) but what I’m after (with both Universal Links on iOS, which already works, and with an intent filter on Android, which I’m asking about) is the ability to have my app indicate to the OS that it can handle links to my web domain (like https://mydomain.com/some/path/my/app/knows/about). This is much nicer for a handful of reasons – for example, I can send notification emails with regular HTTPS links, and the email works correctly on desktop while automatically opening the app when available on mobile.

Thanks again for your help!

1 Like
#4

Hi @schneidmaster - you’re right, this isn’t something we support yet on Android. You can add/upvote it on canny, but if you’d like to send a PR, that would be the fastest and we’d certainly be interested! Our OSS stuff is not the easiest to find and contribute to as it’s spread across multiple repos (sorry :confused:) but the relevant files are this script and this template AndroidManifest.xml.

The API you’ve suggested sounds good to me from a quick perusal. Feel free to ping me if you have any other questions or run into any issues!

#5

@esamelson Thanks! Those pointers are super helpful. I’ll take a look this week and see what I can work out – seems trivial to add the configuration itself but I’ll need to work out how to test that it actually works once the manifest.xml is generated with the new intent filters.

2 Likes
closed #6

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.