-
Notifications
You must be signed in to change notification settings - Fork 941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Places: Bug: missing fields to request on place details #705
Comments
You are correct that the objects are different and the reason you're seeing this difference is because you're using two different libraries: (1) the My recommendation is to remove your dependency on this library and stick with the Places SDK for Android. If you need to get nearby places, you can use the findCurrentPlace() API or the findAutocompletePredictions() API on Android. Our sample app also demonstrates how this can be used. |
@arriolac Why isn't there an official SDK from Google for them both? This causes fragmentation and confusion. What do you mean about " findCurrentPlace() API or the findAutocompletePredictions() API " ? Instead of which parts? Please explain what to do. |
|
@arriolac Why is it called this way? Why "prediction" ? Why "autoComplete" ? It's very un-intuitive when the API is about nearby-search and getting details about places. Are you sure that this API is as complete as the current repository? |
The suggestion I had above is the closest replacement for nearby search, although I realize that it's not a true replacement for the functionality offered by the Places API. If you need that request on your app, and the suggestions I made above won't work, then setting up a proxy is the safest way to do so. This table contains a list of data fields not included in the Places SDK for Android which are aligned with your observations: https://developers.google.com/places/web-service/place-data-fields |
@arriolac OK so what's missing compared to what's here? On the table, it shows that "Places SDK for Android" misses Address, URL, and Vicinity. Is it what I'm supposed to look at? |
This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you! |
Closing this. Please reopen if you believe it should be addressed. Thank you for your contribution. |
The list of supported Place fields in Android is provided here. https://developers.google.com/maps/documentation/places/android-sdk/place-data-fields |
@wangela Can you please update the code to have JavaDocs to point there? |
Environment details
Android 11, but it doesn't matter
implementation 'com.google.android.libraries.places:places:2.4.0'
Steps to reproduce
Try to get most updated information of a place details, after you got its basic ones via nearby-search.
Code example
From this you get an array of PlacesSearchResult:
https://googlemaps.github.io/google-maps-services-java/v0.2.4/javadoc/com/google/maps/model/PlacesSearchResult.html
Some of them are free:
https://developers.google.com/places/web-service/usage-and-billing#basic-data
And some aren't:
https://developers.google.com/places/web-service/usage-and-billing#contact-data
I wanted to have updated information of : name, vicinity, location (LatLng), rating, phoneNumber, websiteUri, permanentlyClosed, and openingHours.
So this is what I tried (using this: https://developers.google.com/places/android-sdk/reference/com/google/android/libraries/places/api/net/PlacesClient#fetchPlace(com.google.android.libraries.places.api.net.FetchPlaceRequest) https://developers.google.com/places/android-sdk/place-details https://developers.google.com/places/web-service/details#PlaceDetailsResults ) :
The problem is, from this you get a different class called
Place
(here: https://developers.google.com/places/android-sdk/reference/com/google/android/libraries/places/api/model/Place ) , and it has different set of fields, and some seem missing:Place
. However, I can seeaddress
instead.geometry?.location
and I think for Place it's onlatLng
, but for some reason the type for each is different...How could it be? Why can't I have the same fields as on PlacesSearchResult, but updated? How can I update the permanentlyClosed ? Am I correct about the fields that do seem to match ?
I've even noticed I can't set the language (useful in case the user has change the language) to query.
Am I doing things wrong?
The text was updated successfully, but these errors were encountered: