美文网首页
024-地图系列04-iOS百度地图定位集成

024-地图系列04-iOS百度地图定位集成

作者: AncientMing | 来源:发表于2018-04-12 19:26 被阅读49次

一、申请秘钥

要使用百度地图就必须要有秘钥,申请网址:

百度地图秘钥申请网址

  • 附:依赖库
CoreLocation.framework
SystemConfiguration.framework
Security.framework
libsqlite3.0.tbd
CoreTelephony.framework
libstdc++.6.0.9.tbd
AdSupport.framework

其中,地图模块不包含的为

AdSupport.framework

需要加的配置信息

App Transport Security Settings

下面值改为YES

Allow Arbitrary Loads

权限

Privacy - Location Always and When In Use Usage Description

值为

NSLocationAlwaysAndWhenInUseUsageDescription
  • 还有一个
Privacy - Location When In Use Usage Description

值为

NSLocationWhenInUseUsageDescription

1)只允许前台使用时定位,需要在info.plist里添加:NSLocationWhenInUseUsageDescription

2)允许永久使用时定位,需要在info.plist里添加:NSLocationWhenInUseUsageDescription, NSLocationAlwaysUsageDescription,NSLocationAlwaysAndWhenInUseUsageDescription

相关文章

网友评论

      本文标题:024-地图系列04-iOS百度地图定位集成

      本文链接:https://www.haomeiwen.com/subject/qcmfkftx.html