-1

我已经在我的 iOS 应用程序中使用 GMSAutocompleteViewController 成功实现了 Place Autocomplete。我在中国使用TestFlight进行了beta测试,并意识到它在那里不起作用。但目前在中国已经解除了域名maps.google.cn的封锁,允许中国人使用谷歌地图。有没有可能配置iOS SDK,所以它可以在中国工作?

谢谢!

4

1 回答 1

1

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

文档内容如下:

Google Maps Platform 产品通过域名 maps.google.cn 在中国境内提供服务。此域不支持 https。从中国向 Google Maps Platform 产品发出请求时,请将https://maps.googleapis.com替换为http://maps.google.cn

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

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

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

于 2018-06-08T11:31:19.137 回答