Google Maps SDK for iOS in China - ios

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!

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.

Related

Use Google Places nearbySearch function in iOS

In Web API, use the nearbySearch function will return the results nearby the specific coordinate.
But I cannot find a similar function in iOS SDK.
I think the worst way is using REST API likes
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=22.979468,112.544345&radius=100&key=API_KEY by Alamofire
But I have another problem, I don't know how to restrict my API key for iOS REST API only.
I tried to set it for iOS Application but it does not work.
Please give me some idea, thank you very much!
You cannot apply iOS app restriction on web service API key. The only supported restrictions for web services are IP address restrictions. This supposes that you are executing web service requests from your backend server and restrict an API key with IP address of your backend server.
In case of mobile iOS app that means you should create an intermediate server to execute web services and pass responses back to your app in order to protect an API key that you use with web service.
There is a feature request in the Google issue tracker to add nearby search as a part of Places API for iOS:
https://issuetracker.google.com/issues/35830334
Feel free to star this feature request to add your vote and subscribe to further notifications from Google.
Hope this resolves your doubt.

Google Places API for iOS vs Google places Web service

I plan to have an application to list nearby places in a UITableView with UISearchController combined by Auto-complete feature to filter the result of places and I'm trying to use Google Places API.
I'm confused because I don't know which API should I use:
Google Places API Web Service
or
Google Places API for iOS
I didn't find a way to get a list of places in the Google Places API for iOS documentation.
When to use Google Places API Web Service and when to use Google Places API for iOS ? and what works best in my case (get list of places with pagination and filter by name and category options)
I have already generated an API-KEY for Google Places API for iOS can I still use this key in Google Places API Web Service ?
In general, if developing for iOS, you should prefer the Google Places API for iOS. It is designed to be easier to use and more efficient from iOS than using the Web Service.
However, the Places API for iOS is relatively new, and does not yet have all the features of the Web Service. In this case, you might prefer to use only the Web Service, or to combine the Places API for iOS and the Web Service.
For your particular use case, I would recommend using the Places API for iOS getCurrentPlace functionality + Autocomplete. getCurrentPlace returns a list of places where we believe the device to be located.
If that doesn't meet your needs, you could use nearby search from the Web Service + Autocomplete from the iOS API.
For question #2: You cannot use the same API Key for iOS and Web Services. The former requires an iOS Key, and the latter a Server key. You also need to enable both services in the Google Developers Console.

Does the Google Analytics SDK use SSL?

Does the SDK for Google Analytics uses SSL, and thus would need an encryption approval letter for use in an iPhone app?
In case their is any confusion, Apple does require an export compliance letter for SSL
It appears to be a NO. How did I arrive at this conclusion? first I found that for Google Analytics to use SSL, it has to send all data to the https: version of google's server. See: https://www.sslshopper.com/article-enable-ssl-for-google-analytics.html . Then I found a blog post where someone monitored google analytics' connection(s) through iOS, and it wasn't using https:.
See: Monitor Google Analytics requests on an iPhone Application and http://jordan.broughs.net/archives/2012/07/monitoring-google-analytics-for-ios.

iOS apps and Google Geocoding API

I'd like to make use of the Google Geocoding Json api (http://maps.google.com/maps/api/geocode/json?address=%#&sensor=false) in my iOS app, but I donĀ“t find if the use of this URL has any restrictions and/or this may be rejected when submitted to App Store.
Thanks in advance
There are some restrictions, read the documentation in particular the Usage Limits and Maps API Terms of Service License Restrictions.
This would not be a problem for the app store. Apple does not restrict what geocode service you can use.
First thing I noticed is you are using Non-secure URL to access google geocode API, which will give no data from Google side.
Second thing, Apple has rollout some guideline during WWDC 2016 to use always secure URL if you want to access it withing from APP please check out the link so there are chances about maybe they found you are using non-secure link to communicate with web service, and your application will be rejected from Apple.
We are using Google GeoCode and reverse Geocode API within Unity using C# HTTPWebRequest class with the Secure link. our app pass out through Apple Review

Google Places API in iOS application

Let me share my findings before asking the question.
Google Places API documentation says:
"Note: To use the Google Places API you must first request a Maps API
client ID and cryptographic key which you must use to sign your
request URLs. For information on signing URL requests, please see the
URL Authentication documentation within the Web Service APIs home
page."
The Google Places API is still in developer preview.
http://code.google.com/apis/maps/documentation/places/
We need a Client ID (required) and a Signature (required) to use
the Google Places API.
http://code.google.com/apis/maps/documentation/webservices/index.html#URLSigning
And, to get the Signature, we need a Google Adsense account to get
Adsense publisher id (required).
http://gmaps-ws-console.appspot.com/
You can find the requirements to use the Google Places API here.
http://code.google.com/apis/maps/documentation/places/index.html#Requirements
The Signup page for Google Maps API suggest that, "Your service
must be freely accessible to end users. To use Google mapping
technology in other types of applications, please use Google Maps API
Premier. See this FAQ for more information."
http://code.google.com/intl/it-IT/apis/maps/signup.html
Now, here's what i want to know.
I'm planning on using Google Places API in my iOS application. I don't
want to use Adsense. Can i still access the Google Places API for
free? How?
If i can't access the Google Places API for free, what are the costs
associated with using this service, and the available payment models?
I wasn't able to find any particular resources for this information.
Here's a specific scenario. What if my iOS application is free. The
free version uses Google Places API. But... my iOS application has
some additional features which are exposed using In-app Purchase (paid
features). The paid features do not use Google Places API. Is this
acceptable?
We opened up the Google Places API to all developers this week at Google I/O and simplified the Terms and authentication:
http://googlegeodevelopers.blogspot.com/2011/05/places-everybody-show-is-about-to-begin.html
You no longer need to sign your requests, but instead just use a key obtained using the Google APIs console. An AdSense ID is no longer required, but you will need to go though a credit card based identity check in order to upgrade from 1,000 to 100,000 request per day.
You can use the Places API in mobile apps that are free or sold online through a mobile app store such as the Apple App Store or Android Market. For fee desktop apps however will require a Maps API Premier license which will be offered once the Places API graduates from Google Code Labs.
For information on getting started, see the docs:
http://code.google.com/apis/maps/documentation/places/
HTH,
Thor

Resources