gpt4 book ai didi

ios - 如何打开 Google map 点击 Xcode 中的嵌入 map

转载 作者:行者123 更新时间:2023-11-29 01:11:49 26 4
gpt4 key购买 nike

当我点击在 Xcode 中嵌入 google maps sdk 时,我正在尝试打开 Google map 应用程序。请帮助我找到解决方案?

最佳答案

在 .plist 文件“LSApplicationQueriesSchemes”中添加一个键并在其中提及一项“comgooglemaps”。

然后试试这个代码。

if ([[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString:@"comgooglemaps:"]]) {
NSURL *directionsURL = [NSURL URLWithString:@"comgooglemaps://"];
[[UIApplication sharedApplication] openURL:directionsURL];
}
else{
[[UIApplication sharedApplication] openURL:[NSURL
URLWithString:@"https://itunes.apple.com/us/app/google-maps/id585027354?mt=8"]];
}

关于ios - 如何打开 Google map 点击 Xcode 中的嵌入 map ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35650358/

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