<p>Hey guys,</p>
<p>I hope I'm not too late for the game. Recently, I opened an issue for "Go Map!!" to fix the <em>Associated Domains</em> for <a href="https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12-SW1" rel="nofollow">Universal Deeplinks</a> (<a href="https://github.com/bryceco/GoMap/issues/164" data-hovercard-type="issue" data-hovercard-url="/bryceco/GoMap/issues/164/hovercard">GoMap/#164</a>). The way that Universal Links work is that websites host a JSON file (<code>apple-app-site-association</code>) in which they specify which apps should be able to handle certain paths.</p>
<h3>Universal Deeplinks</h3>
<p>As per <a href="https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12-SW1" rel="nofollow">Apple's documentation</a>:</p>
<blockquote>
<p>When users install your app, iOS checks a file that you’ve uploaded to your web server to make sure that your website allows your app to open URLs on its behalf. Only you can create and upload this file, so the association of your website with your app is secure.</p>
<p>Universal links work even when your app is not installed. When your app isn’t installed, tapping a link to your website opens the content in Safari, as users expect.</p>
</blockquote>
<p>Great. So basically what we need to do is to host a file called <code>apple-app-site-association</code> file (see my comment <a href="https://github.com/bryceco/GoMap/issues/164#issuecomment-432018965" data-hovercard-type="issue" data-hovercard-url="/bryceco/GoMap/issues/164/hovercard">here</a>).</p>
<p>But:</p>
<blockquote>
<p>When a user is browsing your website in Safari and they tap a universal link to a URL in the same domain as the current webpage, iOS respects the user’s most likely intent and opens the link in Safari.<br>
If the user taps a universal link to a URL in a different domain, iOS opens the link in your app.</p>
</blockquote>
<p>This means that in order for the "Edit" button on openstreetmap.org to launch "Go Map!!" (if installed), the URL of the button's link needs to have a different domain that <code>openstreetmap.org</code>.</p>
<p>We could use something like <code>launch.openstreetmap.org</code>. Is creating/having an additional (sub) domain a viable option?</p>
<h3>Fallback</h3>
<p>In case the user does not have "Go Map!!" (or another app that is listed in the <code>apple-app-site-association</code> file) installed, a simple HTTP redirect could send the browser to <code>openstreetmap.org/edit</code> as a fallback. I don't have experience setting this up server-side, but believe that's the way to gracefully handle the case.</p>
<h3>Android</h3>
<p>I'm not familiar with Android development, to be honest, but if I understood <a href="https://developer.android.com/training/app-links/deep-linking" rel="nofollow">the documentation</a> correctly, developers are able to specify support for particular domains as well. Could someone validate this information?</p>
<p>I'm looking forward to your input, guys!</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/1478#issuecomment-434066471">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABWnLUR4z4-Vcz5qMWTZiw5P5R8QJEMIks5up2S3gaJpZM4MVzZ7">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABWnLdYMzkbJhmLBd3YTrJPSN3sat79vks5up2S3gaJpZM4MVzZ7.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/openstreetmap/openstreetmap-website","title":"openstreetmap/openstreetmap-website","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/openstreetmap/openstreetmap-website"}},"updates":{"snippets":[{"icon":"PERSON","message":"@wtimme in #1478: Hey guys,\r\n\r\nI hope I'm not too late for the game. Recently, I opened an issue for \"Go Map!!\" to fix the _Associated Domains_ for [Universal Deeplinks][1] ([GoMap/#164][2]). The way that Universal Links work is that websites host a JSON file (`apple-app-site-association`) in which they specify which apps should be able to handle certain paths.\r\n\r\n### Universal Deeplinks\r\n\r\nAs per [Apple's documentation][1]:\r\n\u003e When users install your app, iOS checks a file that you’ve uploaded to your web server to make sure that your website allows your app to open URLs on its behalf. Only you can create and upload this file, so the association of your website with your app is secure.\r\n\u003e \r\n\u003e Universal links work even when your app is not installed. When your app isn’t installed, tapping a link to your website opens the content in Safari, as users expect.\r\n\r\nGreat. So basically what we need to do is to host a file called `apple-app-site-association` file (see my comment [here][3]).\r\n\r\nBut:\r\n\r\n\u003e When a user is browsing your website in Safari and they tap a universal link to a URL in the same domain as the current webpage, iOS respects the user’s most likely intent and opens the link in Safari. \r\n\u003e If the user taps a universal link to a URL in a different domain, iOS opens the link in your app.\r\n\r\nThis means that in order for the \"Edit\" button on openstreetmap.org to launch \"Go Map!!\" (if installed), the URL of the button's link needs to have a different domain that `openstreetmap.org`.\r\n\r\nWe could use something like `launch.openstreetmap.org`. Is creating/having an additional (sub) domain a viable option?\r\n\r\n### Fallback\r\n\r\nIn case the user does not have \"Go Map!!\" (or another app that is listed in the `apple-app-site-association` file) installed, a simple HTTP redirect could send the browser to `openstreetmap.org/edit` as a fallback. I don't have experience setting this up server-side, but believe that's the way to gracefully handle the case.\r\n\r\n### Android\r\n\r\nI'm not familiar with Android development, to be honest, but if I understood [the documentation][4] correctly, developers are able to specify support for particular domains as well. Could someone validate this information?\r\n\r\nI'm looking forward to your input, guys!\r\n\r\n[1]: https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12-SW1\r\n[2]: https://github.com/bryceco/GoMap/issues/164\r\n[3]: https://github.com/bryceco/GoMap/issues/164#issuecomment-432018965\r\n[4]: https://developer.android.com/training/app-links/deep-linking"}],"action":{"name":"View Pull Request","url":"https://github.com/openstreetmap/openstreetmap-website/pull/1478#issuecomment-434066471"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/1478#issuecomment-434066471",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/1478#issuecomment-434066471",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [openstreetmap/openstreetmap-website] Support android intent uri for JOSM style remote control (#1478)",
"sections": [
{
"text": "",
"activityTitle": "**wtimme**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@wtimme",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"openstreetmap/openstreetmap-website\",\n\"issueId\": 1478,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close pull request",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"PullRequestClose\",\n\"repositoryFullName\": \"openstreetmap/openstreetmap-website\",\n\"pullRequestId\": 1478\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/openstreetmap/openstreetmap-website/pull/1478#issuecomment-434066471"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 207042171\n}"
}
],
"themeColor": "26292E"
}
]</script>