...
- A custom app cannot handle ens:// directly on iOS, as the OS has claimed that.
- A custom app on iOS needs to handle a different URL pattern altogether.
The idea is that the custom app will register a domain such as "https://us-STATECODE.en.express" as a universal link
Once configured on the APHL verification server, the server will host the appropriate .well-known links. This work for both iOS and Android apps
(This example is for a different app - iOS setting)
❯ curl -A "iphone" "https://us-moo.en.express/.well-known/apple-app-site-association"
{"applinks":{"details":[{"appIDs":["com.google.test.application"],"components":[{"/":"/*","comment":"handle all urls"}]}]}}For reference, the Android metadata looks like this:
❯ curl "https://us-moo.en.express/.well-known/assetlinks.json"
[{"relation":["delegate_permission/common.handle_all_urls"],"target":{"namespace":"android_app","package_name":"gov.moosylvania.enx","sha256_cert_fingerprints":["A0:78:81:44:73:27:91:F3:0F:38:EE:98:D6:95:BD:B5:4D:3D:9C:81:A2:90:0B:15:59:DC:C3:DB:B5:B6:93:93","45:0B:F6:29:B0:65:82:D1:C8:3A:8B:6F:91:54:02:C0:92:C6:B6:23:C5:D2:49:20:A5:F1:5A:3D:8C:1B:6E:65","AA:14:E8:9D:37:4C:B3:6C:80:E7:9F:73:BC:9A:01:D3:16:77:DC:C6:91:AA:DE:A1:5F:73:74:11:B3:36:A3:91"]}}]For the iOS universal links - if the right app is installed that handles the us-regioncode.en.express domain, then the mobile app will get a chance to handle it. Now, it's up to you to handle the rest of the URL correctly (extract the code).
If the app is not installed, then when the user clicks the link on iOS, the server will redirect them to ens:// which will be picked up by iOS ENX
❯ curl -A "iphone" "https://us-STATECODE.en.express/v?c=SECRETCODE"
<a href="ens://v?c=SECRETCODE&r=US-STATECODE">See Other</a>.
...