ios - Google Maps SDK for iOS 在中国
问题描述
我已经在我的 iOS 应用程序中使用 GMSAutocompleteViewController 成功实现了 Place Autocomplete。我在中国使用TestFlight进行了beta测试,并意识到它在那里不起作用。但目前在中国已经解除了域名maps.google.cn的封锁,允许中国人使用谷歌地图。有没有可能配置iOS SDK,所以它可以在中国工作?
谢谢!
解决方案
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了解一些历史背景。
推荐阅读
- javascript - 当我们单击动态创建的编辑图标时,如何更改输入字段中的值?
- python - Python:将文件中的字符串与字符串文字连接起来
- amazon-web-services - AWS Amplify 在 API 请求中使用访客凭证,而不是经过身份验证的凭证
- c# - C# 中是否有“when()”语句或等效语句?
- dart - 如何使用 dartdoc 生成类似 docs.flutter.io 的 Flutter 文档?
- python - 从具有多个参数的函数定义列表
- android - FastScrolling recyclerView 与 PagedListAdapter
- download - 使用 fullcalendar 下载 ics 文件
- php - 使用 PHP 持续检查文件是否存在
- php - PHP如何让搜索引擎使用标签和LIKE