Google 适用于 iOS 中国的 Maps SDK

Google Maps SDK for iOS in China

我已经在我的 iOS 应用程序中使用 GMSAutocompleteViewController 成功实现了地点自动完成。我在中国使用 TestFlight 进行了 beta 测试,发现它在那里不起作用。但域名 maps.google.cn 目前在中国已解锁,允许中国人使用 Google 地图。有没有可能配置iOS SDK,所以它可以在中国工作?

谢谢!

GMSAutocompleteViewController 是 Google Places iOS SDK 的一部分。 Places SDK 以及 Places API 网络服务需要安全的 https 连接。但是,maps.google.cn 域不支持 https。

文档内容如下:

Google Maps Platform products are served within China from the domain maps.google.cn. This domain does not support https. When making requests to Google Maps Platform products from China, please replace https://maps.googleapis.com with http://maps.google.cn.

来源:https://developers.google.com/maps/faq#china_ws_access

这个障碍导致无法从中文域调用 Places 请求。

您可以查看 https://en.wikipedia.org/wiki/Google_China 了解一些历史背景。