0
votes

Currently on iOS we are using the URL directly like so:

  let parameters = @{
    @"input": query,
    @"key": @"MY_API_KEY",
    @"language": "en",
    @"components": @"country:ca",
  };

  let url = @"https://maps.googleapis.com/maps/api/place/autocomplete/json";

  let request = [self createRequest:url parameters: parameters];

  let task = [self dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {

    if ([responseObject[@"status"] isEqualToString:@"OK"]) {
      let predictions = (NSArray<NSDictionary *> *)responseObject[@"predictions"];

      //parse predictions..
      completion(predictions, nil);
    }

    //..handle error..
  }];

We have gotten an email about deprecation of the Google Places API:

We are writing to remind you that the previous version of Places SDK for Google Maps Platform has been deprecated in January 29, 2019, and will be turned off on July 29, 2019.

In the email it contains a link to: https://developers.google.com/places/ios-sdk/client-migration

My question is, do I really have to import the entire iOS Maps-SDK and iOS Places-SDK just to keep autocomplete suggestions working?

It is much less code for me to make the request and I don't have to import 70mb+ of SDKs..

Is this URL "https://maps.googleapis.com/maps/api/place/autocomplete/json" going to be deprecated too? Or just the SDKs?

1
What is this strange mix of Objective-C and Swift syntax that you have posted in your question? - rmaddy
@rmaddy; It's Objective-C entirely :D I used the macros defined here: pastebin.com/8DM5bksR . In Xcode 8, Apple added C++'s auto type to Objective-C via __auto_type and it was in WWDC so I used it since the rest of my code base uses it. - Brandon
I have say that is cool. It sure makes going between the two languages easier. - rmaddy

1 Answers

2
votes

The URI https://maps.googleapis.com/maps/api/place/autocomplete/json that you mentioned in your question doesn't form part of the Places SDK for iOS. This URI belongs to the Places API web service and corresponding documentation can be found at

https://developers.google.com/places/web-service/autocomplete.

Places API web service wasn't deprecated, so if your code makes direct call to https web service you are OK. There is nothing to worry about.

This deprecation affects only users that use Places SDK for iOS methods that is not your case.

I hope this clarifies your doubt.