EddyVerbruggen / nativescript-directions

:point_up_2: :point_right: :point_down: :point_left: Open the Maps app to show directions to anywhere you like
MIT License
83 stars 21 forks source link

How to set Google Maps as default app #6

Closed jericdeleon closed 7 years ago

jericdeleon commented 7 years ago

Hi, I was able to include and run the plugin in the Android emulator (it works nicely by the way), but I noticed that upon calling Directions.navigate(), I was asked if I should open with: Maps or Browser

Is there any way to direct navigation to Maps only (and not show other app options?)

Not even sure if this can be controlled/set through the plugin alone

EddyVerbruggen commented 7 years ago

Thanks!

You could try adding this:

intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");

just before this line

I would advise not using this though as folks may not have GMaps installed.. and you may run into issues like #2

jericdeleon commented 7 years ago

Given the caveat, having the option to still push Maps only is welcome 👍

Thanks!