Open chrisalexqm opened 5 years ago
Hmm, that's strange, because the demo app in this repo does open Google Maps with that preference passed in. Can you confirm that?
git clone https://github.com/EddyVerbruggen/nativescript-directions
cd nativescript-directions/src
npm run demo.ios.device
Then hit the 'from address to coord' button (last button).
If that works, then what you can try in your project:
@EddyVerbruggen Hello and thanks for answering :D
I couldnt replicate demo app because I am working in Windows with NativeScript SideKick but I could run this issue in the NS Playground: https://play.nativescript.org/?template=play-vue&id=L4M2rY
As you can see I set preferGoogleMaps as true. Hope you can replicate this issue.
Ha, you're running the app inside the Playground app, which doesn't have nativescript-directions installed. I saw you added it yourself (good thinking!), but the only piece missing is the plist entry that allows the app to query the OS whether or not the Google Maps app is installed:
Since it can't determine that without this plist entry, it falls back to Apple Maps. The waypoint overrides that behavior, but that's a different issue really.
So I think your code is correct, and once you run it as a standalone app it'll probably work just fine.
Ohhh well, I added comgooglemaps
to my Info.plist and it still opening Maps from iOS. I can use directly the functions inside plugin but I want to contribute to the community by solving this issue and improving the plugin 😸 . I will try removing platform/ios folder and I'll tell you.
Thanks for your time!
THANK YOU! I'd be happy to merge any code/doc you want to PR.
I test with fb://
appAvailability and it is returning false, the same with comgooglemaps://
. I have installed both of those applications. I added this to my Info.plist
comgooglemaps fb
I am doing something bad?
That’s hard to tell without the actual code. Can you share a minimal repo?
I uploaded this https://github.com/chrisalexqm/directionstest tell me if you can run it
@chrisalexqm Runs fine. I didn't have Google Maps on my iPad so it opened Apple Maps. Then I installed the Google Maps apps and this prompt was shown (as expected):
In Dutch: "Directions wants to open Google Maps. [Cancel / Open]"
After accepting this (one-time) prompt it opened Google Maps. So all is working fine with your app for me.
Well, definitely I don't know what is happening... Uhmm could be the way how SideKick build the app 🤔
I set
preferGoogleMaps: true,
in iOS options but it doesnt open Google Maps App (Google Maps is installed) instead it opens iOS Maps App.Maybe I am wrong, help me please :D
PD: Only when I set an array in
to:
it opens Google Maps with way points (I think this is because open the web url)