gpt4 book ai didi

ios - 如何在 iOS 上打开 Google Maps URL Scheme?

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:46:23 27 4
gpt4 key购买 nike

AS google map SDK doc description ,我们可以使用下面的代码调用原生谷歌地图来完成路线。但是如何在我的 Xcode 上测试这些代码呢?它总是返回“不能使用 comgooglemaps://”?

if ([[UIApplication sharedApplication] canOpenURL:
[NSURL URLWithString:@"comgooglemaps://"]]) {
[[UIApplication sharedApplication] openURL:
[NSURL URLWithString:@"comgooglemaps://?center=40.765819,-73.975866&zoom=14&views=traffic"]];
} else {NSLog(@"Can't use comgooglemaps://");
}

最佳答案

如果是 iOS 9,你可能想试试这个:在 info 下自定义 iOS 目标属性,LSApplicationQueriesSchemes。添加 comgooglemaps

enter image description here

关于ios - 如何在 iOS 上打开 Google Maps URL Scheme?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23050818/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com