Search code examples
iosgoogle-mapsgoogle-maps-sdk-iosgreat-firewall-of-china

Google Maps SDK for iOS in China


I have successfully implemented Place Autocomplete using GMSAutocompleteViewController in my iOS application. I have made a beta testing using TestFlight in China and realized that it doesn't work there. But domain maps.google.cn is currently unblocked in China which allows Chinese people to use Google Maps. Is there any possibility to configure iOS SDK, so it could work in China?

Thanks!


Solution

  • GMSAutocompleteViewController is a part of Google Places iOS SDK. Places SDK as well as Places API web service requires secure https connection. However, the maps.google.cn domain doesn't support https.

    The documentation reads:

    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.

    source: https://developers.google.com/maps/faq#china_ws_access

    This obstacle makes it impossible to call Places requests from Chinese domain.

    You can have a look at https://en.wikipedia.org/wiki/Google_China for some historical background.