Ios 无法从安全连接和GMSTileURLConstructor加载google地图互动程序
我正在尝试从SSL URL加载贴图分幅。我加载磁贴的代码如下所示:Ios 无法从安全连接和GMSTileURLConstructor加载google地图互动程序,ios,google-maps,ssl,Ios,Google Maps,Ssl,我正在尝试从SSL URL加载贴图分幅。我加载磁贴的代码如下所示: func initializeTiles() { let urlInfo:GMSTileURLConstructor = { (x: UInt, y: UInt, zoom: UInt) -> URL in let baseUrl = Constants.MAPS_BASE_URL let tileUrl = "\(baseUrl)ImageryMaps&channel=1
func initializeTiles() {
let urlInfo:GMSTileURLConstructor = { (x: UInt, y: UInt, zoom: UInt) -> URL in
let baseUrl = Constants.MAPS_BASE_URL
let tileUrl = "\(baseUrl)ImageryMaps&channel=1006&version=1&x=\(x)&y=\(y)&z=\(zoom)&is2d=t"
return URL(string: tileUrl)!
}
let layer = GMSURLTileLayer(urlConstructor: urlInfo)
if mapView != nil {
DispatchQueue.main.async {
layer.zIndex = 100
layer.tileSize = 512
layer.map = self.mapView
}
}
}
此代码已使用非安全URL进行了测试,并成功加载了磁贴。将此代码与SSL url一起使用时,我得到以下信息:
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9824)
我读过很多关于这个错误的帖子,大多数都指向对info.plist文件进行更改。我已经对plist做了适当的更改,结果是相同的错误。以下是我添加到plist的设置:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>xxxxxxx.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
NSAppTransportSecurity
NSAllowsArbitraryLoads
NSExceptionDomains
xxxxxxx.com
n包括多个域
N异常低安全Http负载
我已经没有办法或想法去尝试了。对info.plist进行更改似乎对应用程序没有任何影响
有人能推荐一些别的东西来试试吗?谢谢