EAS Build: Android applinks (intent filters or deeplink config) do not work with autoFilter:true in EAS build

See original GitHub issue

Summary

Hi I have been using EAS build to distribute and run on production.

I use android intentfilters to directly open the app (when the auto verify is true).

Config in reproducible demo

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

42.0

Environment

Expo CLI 4.13.0 environment info: System: OS: macOS 11.6 Shell: 3.2.57 - /bin/bash Binaries: Node: 16.1.0 - /usr/local/bin/node Yarn: 1.22.11 - /usr/local/bin/yarn npm: 7.17.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4 IDEs: Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild npmPackages: expo: ^42.0.0 => 42.0.5 react: 16.13.1 => 16.13.1 react-dom: 16.13.1 => 16.13.1 react-native: ~0.63.4 => 0.63.4 react-native-web: ~0.13.12 => 0.13.18 npmGlobalPackages: expo-cli: 4.13.0 Expo Workflow: managed

Reproducible demo

"intentFilters": [
        {
          "autoVerify": true,
          "action": "VIEW",
          "data":
          {
              "scheme": "https",
              "host": "mydomain.com",
              "pathPrefix": "/applogin"
            },
          "category": [
            "BROWSABLE",
            "DEFAULT"
          ]
        }
      ]

This config works on expo build and applinks are auto verified, so the link directly opens the app. But on EAS build the app is not directly opened and it asks for how to open the app. Am I missing something when it comes to applinks (deeplinks) in android

In androidManifest.xml, it takes this form:

  <intent-filter android:autoVerify="true">
        <data android:scheme="https" android:host="mydomain.com" android:pathPrefix="/applogin"/>
        <data android:scheme="exp+appname"/>
        <action android:name="android.intent.action.VIEW"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <category android:name="android.intent.category.DEFAULT"/>
      </intent-filter>

Still does not work as intended. I have also hosted the file on /.well-known/assetlinks.json and it works with the expo build workflow. Not the app link workflow.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

9reactions
janfranco27commented, Mar 3, 2022

I have had the same issue in a managed project + dev client. Looks like, when adding intentFilters to the app.config.js file, expo updates the AndroidManifest.xml file and includes something similar to:

<intent-filter android:autoVerify="true" data-generated="true">
        <action android:name="android.intent.action.VIEW"/>
        <data android:scheme="https" android:host="yourhost" android:pathPrefix="your-path-prefix"/>
        <data android:scheme="exp+<your app name>"/>
        <category android:name="android.intent.category.BROWSABLE"/>
        <category android:name="android.intent.category.DEFAULT"/>
      </intent-filter>

This bit <data android:scheme="exp+<your app name>"/> seems to be the problem, causing auto verify not to work properly. I have confirmed it by only removing that line, building the app via expo run:android, and testing app links, which are working fine. By now, I intend to create an expo config plugin to add the intent-filter directly without having to do it via app.config.js

5reactions
janfranco27commented, Oct 27, 2022

Hey @ajimenezdev I ended up relying on this implementation https://github.com/expo/expo/issues/19745 Looks like someone at the Expo team also experienced this and provided a plugin in that ticket. You can find it under the section withAndroidVerifiedLinksWorkaround.js. Hope it helps!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create Deep Links to App Content - Android Developers
To create a link to your app content, add an intent filter that contains these elements and attribute values in your manifest:.
Read more >
Installing app variants on the same device
When you run eas build --profile production the APP_VARIANT variable environment will not be set, and the build will run as the production...
Read more >
android - Deep-linking intent does not work - Stack Overflow
EDIT: Ok first make sure that your package is reachable by adb: adb shell am start -n com.example.simon.test/.activities.MainActivity.
Read more >
Your Deep Links Might Be Broken: Web Intents and Android 12
Not utilizing Android App Links will result in links always being shown in a web browser and not your application. We will explain...
Read more >
Deep Links Crash Course : Part 3 Troubleshooting ... - Medium
What do you do when your Android App Links don't work the way you want them to? ... Setting the autoVerify attribute of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found