0

When i load Place picker it initially loads but later i am not able to select any places as it goes off

    func placePicker(_ viewController: GMSPlacePickerViewController, didPick place: GMSPlace) {
    print("Place name \(place.name)")
    print("Place address \(place.formattedAddress)")
    print("Place attributions \(place.attributions)")
    viewController.dismiss(animated: true, completion: nil)

}
func placePickerDidCancel(_ viewController: GMSPlacePickerViewController) {
    // Dismiss the place picker, as it cannot dismiss itself.
    viewController.dismiss(animated: true, completion: nil)

    print("No place selected")
}

enter image description here

Rahul Pahuja
  • 31
  • 10
  • Can you please post code to present placepicker controller – Hitesh Surani May 16 '19 at 10:23
  • Possible duplicate of [GMSAutocompleteViewController showing only 5 results](https://stackoverflow.com/questions/55644324/gmsautocompleteviewcontroller-showing-only-5-results) – Nitish May 16 '19 at 10:26
  • It's the change in google services. They are no more free. Refer to above link. – Nitish May 16 '19 at 10:27

1 Answers1

0

In a few month before it was quite easily and can fix by ,

API Key as same as Google Maps APIKey

If it didn't fix your solution the a few things to look out like described here

First, go to https://console.developers.google.com/apis/ and make sure the Google Places API is enabled. Select your project on the top left, then select library on the left as well. Then, look for "Places API" and enable the API.

enter image description here

enter image description here

Second, make sure you have a billing account enabled. To do so, go to https://console.developers.google.com/billing/ and proceed to create an account. Make sure your project is linked to this account as well. To link the account, go to your project and select the "Billing" option from the hamburger menu on the top left corner.

Lastly, if you have application restrictions, make sure the bundle identifier from your iOS project is associated with the API key you're using. Go to your project in XCode, click on the General tab, and copy the value by "Bundle Identifier". Then, go back to https://console.developers.google.com/apis/ and make sure your project is selected. Then, go to the "Credentials" tab on the left. Select your key, and go down to where it says Accept requests from an iOS application with one of these bundle identifiers and paste the value in the text box below.

If you have API restrictions, make sure the Places API is added to your list of accessible APIs.

Click "Regenerate Key" at the top and use the new key generated under where it says "API Key" in your project. This process may take up to 5 minutes to take into effect.

enter image description here enter image description here

Angel F Syrus
  • 1,984
  • 8
  • 23
  • 43