2

Hi i have used GMSAutocompleteViewController full-screen control. https://developers.google.com/places/ios-api/autocomplete#add_an_autocomplete_ui_control

i am not able to get keyboard search click event tried by searchbar event and textfieldshouldreturn event but it is not called. i want to get text which i have typed when any location not found in google.

Nisha
  • 354
  • 2
  • 19
  • Have you initialized your own `UISearchController` and assigned, or simply used `GMSAutocompleteViewController`? If you are not using your own search bar, you won't be able to catch any searchbar event. – NightFury Mar 10 '16 at 12:57
  • simply used GMSAutocompleteViewController. – Nisha Mar 10 '16 at 12:59
  • Go through [this](https://developers.google.com/places/ios-api/autocomplete#add_a_search_bar_to_the_navigation_bar) section. You can access `UISearchController` delegate methods, and catch text for searchbar and other events. – NightFury Mar 10 '16 at 13:03
  • @iAnum its not possible in full-screen control ? i have to use add results controller? http://screencast.com/t/MsSQV4I1 – Nisha Mar 10 '16 at 13:09
  • I am not sure... By looking at docs, it seems like you can't. – NightFury Mar 11 '16 at 06:15

3 Answers3

1

From the Google Places API documentation..

https://developers.google.com/places/ios-api/autocomplete#add_an_autocomplete_ui_control

Use a results controller when you want more control over the text input UI

You can not access search bar if you are using GMSAutocompleteViewController. You have to use GMSAutocompleteResultsViewController.

0

Make sure you have put your provideAPIKey.

0

try removing restriction of the api from the console

https://console.cloud.google.com/apis/credentials?project=.

it helped me.

thnx

Vikram Sinha
  • 581
  • 1
  • 10
  • 25