Skip to content
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

Navigation for IOS In India #4

Closed
MarkDsantos opened this issue Jan 23, 2015 · 4 comments
Closed

Navigation for IOS In India #4

MarkDsantos opened this issue Jan 23, 2015 · 4 comments

Comments

@MarkDsantos
Copy link

Hi,
I'm creating a Cordova app for android & ios that provides navigation support.
The plugin was extremely helpful & worked well in android. However I'm from India and hence i'm unable to access the navigation options on the ios platform using the plugin. Can you please suggest any solutions to make this feature work for the ios platform.

Thank you.

photo

@dpa99c
Copy link
Owner

dpa99c commented Jan 23, 2015

Apple Maps currently doesn't support navigation in India: https://www.apple.com/in/ios/feature-availability/

While this is rubbish (India has a huge population, why would they miss out on this market?), this plugin currently relies on Apple Maps navigation for iOS.

However, it appears there might be a workaround. When the Google Maps app is installed on iOS, a new magic protocol becomes available: https://developers.google.com/maps/documentation/ios/urlscheme

So from within the Javascript of your Phonegap/Cordova app you can use it to launch Google Maps in navigation mode, e.g. window.location ="comgooglemaps://?saddr=Mumbai&daddr=Bangalore&directionsmode=transit"

Hope that helps!

@MarkDsantos
Copy link
Author

Hi,
Thanks A Bunch!!! This seriously made my day. Thanks for the advice :)

@MarkDsantos
Copy link
Author

Hi again,
The window .location method you suggested works like a charm in ios. However I have a doubt.
When the above command is called, the device opens the gmaps and my app moves to the background. Can you please give me any advice on any methods to bring back my cordova ios app to the fore ground when i exit the gmaps using the ios home button if there are.

Really sorry for the extra trouble.

@dpa99c
Copy link
Owner

dpa99c commented Jan 24, 2015

You'd need to provide a callback to Google Maps as outlined here: https://developers.google.com/maps/documentation/ios/urlscheme#add_a_back_button_to_google_maps_for_ios

For this to work, your app would need to define and implement its own URL scheme in order to respond to the callback. You'll need a plugin to do this, for example this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants