科尔多瓦iOS启动comgooglemaps失败 [英] Cordova iOS launch comgooglemaps fail

查看:96
本文介绍了科尔多瓦iOS启动comgooglemaps失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小问题. 我使用comgooglemaps方案调用Google地图并执行搜索. 可以,但是问题是用户是否未安装谷歌地图.

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?

感谢!

推荐答案

您可以使用提供了通用的跨平台URL来启动Google Maps的Google Maps URLs .目前,推荐并支持这种方式来打开Goog​​le Maps应用.

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.

根据文档

在iOS设备上:

On an iOS device:

  • 如果安装了iOS版Google Maps应用,则该网址会在Maps应用中启动Google Maps并执行请求的操作.

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

如果未安装Google Maps应用,则该URL在浏览器中启动Google Maps并执行请求的操作.

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

这种行为几乎就是您要问的,因此,将comgooglemaps方案替换为Google Maps URL(例如https://www.google.com/maps/search/?api=1&parameters),您就可以解决了.

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!

这篇关于科尔多瓦iOS启动comgooglemaps失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆