Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Using Google Places API

Has anyone used the Google Places API in an app? I'm working on an app that will use it but haven't receive an api key for.

I've filled out the form at http://gmaps-ws-console.appspot.com/. Will they send one for Places or do you using the same key you use with the google maps api.

— asked January 31st 2011 by Jason Calvert
  • api
  • google
  • places
2 Comments
  • i was looking into it yesterday and noticed it was locked down under beta still. how long ago did you request a key

    — commented January 31st 2011 by Aaron Saunders
  • I filled out their form last Thursday and received a message "Your information has been saved". I read on the Google code forum that someone will contact you if you get accepted.

    — commented January 31st 2011 by Jason Calvert

4 Answers

  • Jason how can you connect appcelerator with places app from google??

    — answered April 4th 2012 by Sara Saied
    permalink
    0 Comments
  • Sara: You could use the Google Places API for mobile.

    Construct and send a request in the following format (from your mobile app):
    https://maps.googleapis.com/maps/api/place/search/json?location=-41.11,81.19&radius=50&name=hospital&sensor=true&key=YourKey

    The response will be a JSON object (or XML, if that's your preferred response format) containing the Places near the user's location.

    More details can be found at https://developers.google.com/maps/documentation/places/

    — answered June 21st 2012 by Pallavi Sivakumaran
    permalink
    1 Comment
    • ouch, I'd better have made my question a comment to your post…

      — commented June 23rd 2012 by patrick demarta
  • Pallavi: I'm currently trying to access the google places with a Ti.Network.HTTPClient instance (providing my api key in the params lis, and sensor=true) … I guess i'm following the api specs in my request url.

    I saw your very recent post about this, so I thought maybe you could help in my trouble-shooting.
    The fact is I'm getting an SSL error, stating:

    Error Domain=ASIHTTPRequestErrorDomain Code=1 "A connection failure occurred: SSL problem (Possible causes may include a bad/expired/self-signed certificate, clock set to wrong date)" UserInfo=0x8c78850 {NSUnderlyingError=0x8c78880 "The operation couldn’t be completed. (OSStatus error -9800.)", NSLocalizedDescription=A connection failure occurred: SSL problem (Possible causes may include a bad/expired/self-signed certificate, clock set to wrong date)}

    I'm not sure about the origin, but I found some discussions pointing to iOS validation of self-signed certificates. As I understand this api-key is one of this kind.

    I also tried setting explicitly the value of HHTPClient.validatesSecureCertificate to false (the api-doc says it defaults to false) with no changes in connection success.

    I hope I made myself clear enough, and I wish you'll have some suggestion to point main the right direction.

    Thanks in advance,
    regards.

    — answered June 23rd 2012 by patrick demarta
    permalink
    2 Comments
    • forgot to say:
      TI SDK : 2.0.2.GA,
      iOS SDK : 5.0

      — commented June 23rd 2012 by patrick demarta
    • the url which is failing in the app (https://maps.googleapis.com/maps/api/place/search/json?location=45.4024,9.1287&radius=50000&sensor=true&key=AIzaSyDpxD_voGEnlF-8hDTgyxEmkpi13JpdYJE) works pretty well in a browser, so definitely I'd look in what's wrong with my httpclient GET from https://…

      — commented June 23rd 2012 by patrick demarta
  • Now following to :
    http://developer.appcelerator.com/question/138147/createhttpclient—ssl-problem-on-some-api-call

    as it looks like the problem isn't in my own code.

    — answered June 23rd 2012 by patrick demarta
    permalink
    1 Comment
    • The issue is resolved in the new 2.1.0 SDK, current last build @
      http://builds.appcelerator.com.s3.amazonaws.com/mobile/master/mobilesdk-2.1.0.v20120622174154-osx.zip

      — commented June 23rd 2012 by patrick demarta
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.