Cordova iOS launch comgooglemaps fail

时光怂恿深爱的人放手 提交于 2019-12-10 23:49:39

问题


I have a small problem. I use comgooglemaps scheme to call google maps and perform a search. This works ok but problem is if user don't have a google maps installed.

Now... how can i check this and if google maps are not installed to call google via browser? ... or to call some other maps app that user uses?

Thanx!


回答1:


You can use Google Maps URLs that provides universal cross-platform URL to launch Google Maps. Currently this is recommended and supported way to open Google Maps app.

According to the documentation

On an iOS device:

  • If Google Maps app for iOS is installed, the URL launches Google Maps in the Maps app and performs the requested action.

  • If the Google Maps app is not installed, the URL launches Google Maps in a browser and performs the requested action.

This behavior is pretty much what you were asking about, so replace comgooglemaps scheme with Google Maps URL (e.g. https://www.google.com/maps/search/?api=1&parameters) and you are settled.

I hope this helps!



来源:https://stackoverflow.com/questions/50379588/cordova-ios-launch-comgooglemaps-fail

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!