I integrated GMSAutocompleteViewController in my app.
let autocompleteController = GMSAutocompleteViewController()
autocompleteController.delegate = self
let filter = GMSAutocompleteFilter()
filter.type = .address
autocompleteController.autocompleteFilter = filter
// Display the autocomplete view controller.
present(autocompleteController, animated: true, completion: nil)
This always shows only 5 results. Also, the behaviour seems to be a bit weird. At first when I write J in the search, 5 results are displayed. After writing some more text and removing those to again set the search text as J, I get - Can't load results. And then results are never displayed unless I relaunch my app.
I tried the same implementation in Android using AutocompleteSupportFragment
and it works very well. I was earlier wondering after seeing Ravi's answer, and few others as well. But if enabling billing was the solution, why is it working fine in Android without enabling billing ?
I am assuming that you have Google Places API enabled and as well you have no application restrictions under your Google Developer Console for that project. Said that there is a Google page about APIs and billing
Android and iOS Places APIs might differ, and hence for some APIs you might need to enable billing:
Some APIs allow free usage up to a courtesy usage limit, and in some
cases this free limit is increased when you enable billing.
Maybe in your Android App you are using an API linked to a project that has billing enabled and for your iOS App you are using an API linked to another project where billing is not enabled.
Billing is enabled at the project level, not the API level. If you
enable billing for a project, then every billable API in that project
is billed, based on the project's usage. All usage in a project is
billed using the payment method that you specify, and you can change
to a different method at any time. You cannot selectively enable
billing for some APIs but not others; when you enable billing for a
project, it applies to all the APIs that you used within that project,
even if the API is currently disabled.
Maybe something is related to the version of Places SDK you are using in your Android App Project and some of its inner functionality could affect if you are going to talk to their updated APIs version which requires Billing to be enabled or not. Check information stated in Migrating to the New Places SDK Client for this assumption.
Lastly, as stated from lots of documentations from Google in Places SDK for Android, Places SDK for iOS, Places API, they all have a red warning in the beginning of each article saying that in each project you should enable Billing. If all my before statements fails, it might mean that they are applying the rule of Billing and APIs functionality restriction in different batches of users/projects, and hence your android app project might have fall in a batch that still hasn't rolled out to force Billing option enabled.
I experienced a similar problem. Was trying to implement the New Places API from Google to replace the old SDK's Place Picker. After one or two successful calls per day I always started getting the following error:
An error occurred: The operation couldn’t be completed. Operation
failed due to exceeding the quota usage limit. See the usage limits
guide (https://developers.google.com/places/ios-sdk/usage) for
information on usage limits and how to request a higher limit.
I had the Places API enabled in the console and also enabled billing with a valid credit card. Was still getting this error.
The solution was to enable Maps SDK for iOS from the Google Cloud Platform. After that I had no limits to the requests and was getting results every time. Hope that helps someone.