-
Notifications
You must be signed in to change notification settings - Fork 923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support android intent uri for JOSM style remote control #1478
base: master
Are you sure you want to change the base?
Conversation
Documentation:
I suppose we could use the fallback url to produce some kind of error message if necessary. I haven't run exhaustive tests against the stock browsers yet (but on the other hand have yet to find one with which it doesn't work). FF is as of yet untested. |
} | ||
}; | ||
|
||
function url() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is far too vague as a name for this function at this scope - it should either be more explanatory or the function should be pushed down inside remoteEditHandler
so that the meaning is implicit.
That said I'm not really sure we it needs to be a function and can't just be done inline in remoteEditHandler
without having to repeat the android test...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically you wouldn't want to use a function for this or below just for one variant, I just wanted to leave the door open for potential support of at least GoMap!!. But @bryceco needs to weigh in on that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine, but call it remoteEditUrl
or something and pass it the query string so the whole of the url logic can be in one place...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, we could use L.Browser.android
, see https://leafletjs.com/reference-1.6.0.html#browser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No using leaflet internals for non-leaflet things is a terrible idea.
@@ -255,17 +281,17 @@ $(document).ready(function () { | |||
var iframe = $('<iframe>') | |||
.hide() | |||
.appendTo('body') | |||
.attr("src", url + querystring.stringify(query)) | |||
.attr("src", url() + querystring.stringify(query) + (android ? '#Intent;scheme=josm;end;':'')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If url
is going to stay as a function then I would just pass query
in to it and let it figure out the whole URL in one go rather than splitting the logic for the intent URL across two different locations.
Go Map!! supports geo: and gomaposm: URL schemes. I'm a bit out of the loop as to how that gets hooked up here. |
@bryceco It was me, bringing you in the loop on my last vacation, as i tried used GoMap on an iPad. I do not want to misuse Geourls for editing. If i have a geo url, i would like, to open a MAP and not an Editor. Thats why i brought up: |
To summarize the situation with osm.org and mobile editing:
|
Seems as setting the iframe src will definitely not work in iOS 9. For other long winded approaches see http://stackoverflow.com/questions/32689483/ios9-try-to-open-app-via-scheme-if-possible-or-redirect-to-app-store-otherwise and others. |
Seems the Apple Approved™ way for iOS is "Universal Links" which seems to involve registering a domain against your app on developer.apple.com and then hosting a JSON on file on that domain (with SSL mandatory) that says what paths map to what apps... |
when on an android device.
Hey guys, I hope I'm not too late to the game. Recently, I opened an issue for "Go Map!!" to fix the Associated Domains for Universal Deeplinks (GoMap/#164). The way that Universal Links work is that websites host a JSON file ( Universal DeeplinksAs per Apple's documentation:
Great. So basically what we need to do is to host a file called But:
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 We could use something like FallbackIn case the user does not have "Go Map!!" (or another app that is listed in the AndroidI'm not familiar with Android development, to be honest, but if I understood the documentation 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! |
@wtimme Android is not an issue as that actually works modulo a bit of bitrot. I just didn't see a lot of point in moving forward with this just for one app. For GoMap!! the question is if we can supply a bounding box or similar as a parameter in the URL or not, without that it doesn't make a lot of sense. |
Sorry, I don't know this expression. Do you mean that it bloats the software? 🤔
Yes, Universal Deeplinks are passed to the iOS app in a whole, including the anchor ( As far as "one Universal Link for all platforms", I don't know if anchor tags reach the server-level where a HTTP redirect would typically be implemented. Expected behaviourJust to make it clear, here's what I understood:
|
GoMap!! doesn’t support a bounding box, but it does support a centerpoint and a zoom level. |
@wtimme as I understand it what you're requesting here is nothing to do with android intents, so it doesn't seem to be anything to do with this ticket? It also sounds like it is mostly an operational/chef request given that it's a request for a separate web site rather than anything to do with the www.osm.org code - the only change to the web site would be to allow the edit link to point to this new domain I think? That said it all sounds awfully involved - does iOS really not have a way to trigger an app from a web page without having to create separate web sites to act as an intermediary?!?! |
The PR is old so it worked one year ago |
The mechanism described in #1478 (comment) – essentially, registering as a replacement for the browser for a given domain – is Apple’s preferred mechanism for unspoofability reasons. But as mentioned in bryceco/GoMap#235 (comment), it’s also possible for osm.org to link to something like |
Currently, you do not get the editor links on iPhones (you get them on iPad though). This is deliberately of course, so I guess it would be easy to show it if the link to edit with GoMap!! became working. Potlatch1+2 on the other hand, have no purpose on mobile, because they require Flash which is not available for mobile devices since 2011. |
Certainly, I was only alluding to how the menu can list editors other than iD and JOSM, not recommending that Potlatch be offered to mobile devices. 🙂 |
Things are now fixed in the latest Go Map!! release in the App Store. You can launch the app using a URL like |
Note to self: according to a comment in #3760 (comment), this issue might be superseded by #3760 (pending positive test outcome). |
This is WIP.
On Android the normal Urls will actually work, but not as source of an iframe, that's why we need custom code (using a custom scheme in the uri is frowned upon, but I'm a repeat offender).
One aspect that needs work is handling errors, unluckily it is rather unclear if it can be done in any reasonable fashion. The other thing is that I haven't done anything with the "Edit" button because while showing it would work without problems for Vespucci that doesn't go for anything else.
Documentation on how to set up the Android side follows.