1

Based on the documentation (Associating a website with multiple apps), it is possible to associate multiple apps as handlers for a website's links. The DAL looks as such:

[{
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.example.puppies.app",
    "sha256_cert_fingerprints":
    ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"]
  }
  },
  {
  "relation": ["delegate_permission/common.handle_all_urls"],
  "target": {
    "namespace": "android_app",
    "package_name": "com.example.monkeys.app",
    "sha256_cert_fingerprints":
    ["14:6D:E9:83:C5:73:06:50:D8:EE:B9:95:2F:34:FC:64:16:A0:83:42:E6:1D:BE:A8:8A:04:96:B2:3F:CF:44:E5"]
  }
}]

Is there a concept of ranking for these entries? If the user has both apps installed, which one will open? I'm hoping there's a deterministic way to ensure one has priority over another.

I am unable to verify the actual behavior due to the issue I'm raising separately here.

siger
  • 3,112
  • 1
  • 27
  • 42

1 Answers1

2

This can be accomplished by setting the priority flag on the intent filter.

https://developer.android.com/guide/topics/manifest/intent-filter-element#priority

siger
  • 3,112
  • 1
  • 27
  • 42
  • Did you try it? Does it work? – A. Khachatryan Jul 07 '22 at 16:17
  • Yes, it did work, though I remember having had to test extensively all possible combinations of priority values and apps being verified or not (for app links) before trusting the setup. – siger Aug 05 '22 at 02:21