Search code examples
iosgoogle-maps-api-3restful-authentication

How does Google Maps see native iPhone apps: Server App or Browser App?


I have a Google API console premier account, and I'm using the places service for an application that has two parts, web app and mobile app.

It seems that Google API distinguishes between server and browser apps. So for each category I have to generate keys specifically for it.

The mobile app is a native iPhone App, that uses the Google Places Web Services XML API for a simple auto complete function.

The question is in which category does mobile apps fall in?

  • Browser Apps
  • Server Apps

And any resources of how to use them?, does the Google JavaScript API V3 still requires an API Key for the premium users? Google documentation about this subject does not have enough information.


Solution

  • There are two different interactive types of Mobile Apps that use Google Maps:

    • ones that use the Maps Javascript API v3 (either directly or embedded in a Native Application)
    • ones that use Native Google Maps APIs (currently available for Android and iPhone)

    For more on that you can have a look at: http://code.google.com/apis/maps/articles/mobile_overview_v3.html

    Ones that use the Maps JS v3 are Browser Apps, the Native Apps are neither. They have their own TOS and quota system, like the one for iPhone and the one for Android.

    About Google Maps JS API v3. It an be loaded :

    • without any key
    • with an API console key, which will allow you to track your usage (this was introduced recently)
    • with Maps Premier client id (gme-) if you are a Maps API Premier customer

    The XML web service for places API should be used only as a server side solution. This is because you can imagine that a user might steal your key from the source of your iPhone app (by sniffing on the traffic) and use it.

    The safe way out is to use a proxy server. You would then register an App Key for server apps (with IP locking for your proxy server) and then make calls to the Places API from this proxy.

    Another option would be to use UIWebView on the iPhone side with JS Maps API v3 and Places library on the Google side. You would then fall in "ones that use the Maps Javascript API v3 in a Native Application" category. You could then use any of the 3 options to load JS Maps API that are mentioned above.

    I had to cut away some links, since I am not able to paste more than two, but I hope that helps anyway