cyclestreets / ios

iPhone app
https://www.cyclestreets.net/mobile/iphone/
178 stars 149 forks source link

Add support for launching routes outside the app #77

Closed mvl22 closed 8 years ago

mvl22 commented 11 years ago

See: https://github.com/citymapper/CMMapLauncher

We've also had a developer of another app asking about this.

mvl22 commented 10 years ago

Another app maker has just been in contact about this and would like to be able to launch our app from theirs, i.e. the user clicks a link like:

cyclestreets://journey/9591212

which would then open the journey directly.

It seems the requirements are:

1) Register a protocol handler 2) Add support for URLs with a specific scheme.

This seems to be a good overview of what code changes are needed: http://stackoverflow.com/questions/11421048/android-ios-custom-uri-protocol-handling

neilkachu commented 10 years ago

This is already supported, the urlScheme for CS is cyclestreets and we grab the last fragment off the url and pass this to the RouteManager. You should be able to test this simply by creating a url in Notes for instance. Note: this will not work if you have Hackney installed as Id not taken the urlscheme out and it'll pick Hackney to send the url to.

mvl22 commented 10 years ago

This is already supported

Awesome! Is this supported only for routes (not sure whether photos is really needed, but I suppose would be nice in future maybe)?

neilkachu commented 10 years ago

Only routes are supported currently. Photos could be supported also.

mvl22 commented 10 years ago

Yep, that seems to work nicely - I'll let the other app developer know, maybe we can do a short blog post about this once Android has support also.

cyclestreets://journey/9591212

does indeed work.