[openstreetmap/openstreetmap-website] Support android intent uri for JOSM style remote control (#1478)

wtimme notifications at github.com
Mon Oct 29 20:27:35 UTC 2018


Hey guys,

I 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.

### Universal Deeplinks

As per [Apple's documentation][1]:
> 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.
> 
> 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.

Great. So basically what we need to do is to host a file called `apple-app-site-association` file (see my comment [here][3]).

But:

> 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. 
> If the user taps a universal link to a URL in a different domain, iOS opens the link in your app.

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 `openstreetmap.org`.

We could use something like `launch.openstreetmap.org`. Is creating/having an additional (sub) domain a viable option?

### Fallback

In 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.

### Android

I'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?

I'm looking forward to your input, guys!

[1]: https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12-SW1
[2]: https://github.com/bryceco/GoMap/issues/164
[3]: https://github.com/bryceco/GoMap/issues/164#issuecomment-432018965
[4]: https://developer.android.com/training/app-links/deep-linking

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1478#issuecomment-434066471
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20181029/0d3f876d/attachment.html>


More information about the rails-dev mailing list