Multiple intentFilters does not seem to work on Android

Please provide the following:

  1. SDK Version: 41 (managed)
  2. Platforms(Android/iOS/web/all): Android
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

I’m using a custom development client built with EAS and trying to test an application with multiple intentFilters configured in the app.json. It seems that only the first intentFilter ends up working, any subsequent filter does not work.

I’ve also checked the the generated AndroidManifest.xml via the Expo Tools vscode plugin, and it confirms my suspicion that only the first intentFilter ends up in the AndroidManifest.xml.

Example config:

app.json:

{
  "expo": {
    "android": {
      "intentFilters": [
        {
          "action": "VIEW",
          "data": {
            "scheme": "https",
            "host": "share.example.app"
          },
          "category": ["BROWSABLE", "DEFAULT"]
        },
        {
          "action": "VIEW",
          "data": {
            "scheme": "https",
            "host": "share-alternative.example.app"
          },
          "category": ["BROWSABLE", "DEFAULT"]
        }
      ]
    },
    }
  }
}

The generated AndroidManifest.xml only contains share.example.app.

"intent-filter": [
  {
    "action": [
      {
        "$": {
          "android:name": "android.intent.action.MAIN"
        }
      }
    ],
    "category": [
      {
        "$": {
          "android:name": "android.intent.category.LAUNCHER"
        }
      }
    ]
  },
  {
    "action": [
      {
        "$": {
          "android:name": "android.intent.action.VIEW"
        }
      }
    ],
    "category": [
      {
        "$": {
          "android:name": "android.intent.category.DEFAULT"
        }
      },
      {
        "$": {
          "android:name": "android.intent.category.BROWSABLE"
        }
      }
    ],
    "data": [
      {
        "$": {
          "android:scheme": "example"
        }
      },
      {
        "$": {
          "android:scheme": "app.example"
        }
      }
    ]
  },
  {
    "data": [
      {
        "$": {
          "android:scheme": "https",
          "android:host": "share.example.app"
        }
      }
    ],
    "action": [
      {
        "$": {
          "android:name": "android.intent.action.VIEW"
        }
      }
    ],
    "category": [
      {
        "$": {
          "android:name": "android.intent.category.BROWSABLE"
        }
      },
      {
        "$": {
          "android:name": "android.intent.category.DEFAULT"
        }
      }
    ]
  }
]

i suggest updating to expo sdk 42 – 41 was the first version where we supported config plugins and we have made a lot of improvements in 42. if the problem persists, please create an issue on Issues · expo/expo · GitHub with a reproducible example

1 Like