Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8174533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:28:59+00:00 2026-06-06T22:28:59+00:00

i am working on one application which requires the feature of adding the custom

  • 0

i am working on one application which requires the feature of adding the custom locations
like. location myhome, myschool etc..
for which i have used the following google api
https://developers.google.com/places/documentation/#adding_a_place

and post the data as required in api.
i have added the following code on clicking add location button.

-(IBAction)submitPressed:(id)sender
{

 NSString *temp = [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/place/add/json"]; 
     temp = [temp stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
     NSLog(@"add location to map url: %@",temp);
     NSURL *url = [NSURL URLWithString:temp];
     NSString *requeststr = @"sensor=false&key=AIzaSyCd4CHYWFPLhw4g5yGJyYZXSV-RZRIQfiM&location=-33.8669710/151.1958750&accuracy=50&name=Google Shoes!&types=shoe_store&language=en-AU";
     requeststr = [requeststr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
        NSData *requestdata = [NSData dataWithBytes:[requeststr UTF8String] length:[requeststr length]];

        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
        [request setHTTPMethod:@"POST"];
        [request setHTTPBody:requestdata];

        NSURLResponse *response = NULL;
        NSError *requestError = NULL;
        NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&requestError];
        NSString *responseString = [[[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding] autorelease];
        NSLog(@"responseString:%@",responseString);
}

when i check log for responseString it shows me

`<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 400 (Bad Request)!!1</title>
  <style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}
  </style>
  <a href=//www.google.com/><img src=//www.google.com/images/errors/logo_sm.gif alt=Google></a>
  <p><b>400.</b> <ins>That’s an error.</ins>
  <p>Your client has issued a malformed or illegal request.  <ins>That’s all we know.</ins>

so, can anyone please help me to find out the mistake or any suggestion for add location to map. i have tried different key in calling the api but everytime showing the same error.
thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T22:29:03+00:00Added an answer on June 6, 2026 at 10:29 pm

    The code is actually slightly more complicated and lengthier than that. I won’t provide all the code so I will point you to a GREAT tutorial with its sample code (only works on iOS Device not on the simulator by the way):

    Tutorial On Google Places for iOS SDK

    Tutorials AMAZING Sample Code Project For Download

    Also just so you know, the reason the output is coming with weird characters is because the response string you are getting is in the form of XML. The project uses JSON however. You will have to parse the XML using NSXMLParser but the project I linked you to has a comprehensive tutorial and the sample project will impress you!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on one application in which I am getting conflicted render result
I am working on an application in which one module accesses a log (an
Currently I am working on a application, which contains one switch. When we touch
I'm working on Asp.net MVC3 web application. I'm having one page on which appx.
hello i have created one windows application in c# .net and its working fine
Background I'm working on an application which requires user-entered content, and I've decided to
I am working on an android application that requires multiple views which will overlap
I have a working JNLP application which I need to distribute to various non-technical
I'm currently working on an application which requires transmission of speech encoded to a
I have my OAuth process working well, I have an application that requires Google

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.