Skip to content
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

Make it possible to specify fields when pick up a place from Autocomplete results because of the new Price System #160

Closed
kidmysoul opened this issue Jul 20, 2018 · 6 comments

Comments

@kidmysoul
Copy link

Hey , thank you for your awesome library. I like it and used it in my app very well.

But as Google has published the new price system of Google Map Platform, to pick up a place from Autocomplete results, it will cost unnecessary money for developers those don't want some especial information for a place like opening_hours, website, price_level, rating, review....

If i can specify only basic fields for picking a place ,it will cost a little cheaper.

As described in the google official article:

SKU: Autocomplete (included with Places Details) – Per Session
An Autocomplete (included with Places Details) – Per Session SKU is charged for an Autocomplete session that includes a Places Details request. The autocomplete request is free, and the subsequent Places Details call gets charged based on regular Places Details pricing (described below).

A Places Details request generates Data SKUs (Basic, Contact, and/or Atmosphere) – depending on the fields that are specified in the request. If you do not specify fields in the Place Details request, all Data SKUs are triggered (Basic, Contact, and Atmosphere). To avoid paying for data that you don't need, call Autocomplete.setFields() to specify only the place data that you will use.

and this is my app costs from June, 1
2018-07-20 16 18 16

the Atmosphere Data and Contact Data which are unnecessary for me cost a lot which is so painful for a app that hasn't make money yet.

@tylercb
Copy link

tylercb commented Aug 2, 2018

It is in the documentation and in the example, you have to use Autocomplete.setFields():

autocomplete.setFields(['address_components', 'geometry', 'icon', 'name']);

https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete

By default, when a user selects a place, autocomplete returns all of the available data fields for the selected place, and you will be billed accordingly. Use Autocomplete.setFields() to specify which place data fields to return. Read more about the PlaceResult object, including a list of place data fields that you can request.

https://developers.google.com/maps/documentation/javascript/places-autocomplete#get_place_information

This is the list of available fields: https://developers.google.com/maps/documentation/javascript/reference/3.exp/places-service#PlaceResult

@kidmysoul
Copy link
Author

@tylercb So how to use setFields for this library? RNGooglePlaces.Autocomplete.setFields()?

@kknd113
Copy link

kknd113 commented Jan 9, 2019

@kidmysoul

autocomplete = RNGooglePlaces.Autocomplete(...);
autocomplete.setFields(['address_components', 'formatted_address', ...]);

@kidmysoul
Copy link
Author

@kknd113
Does RNGooglePlaces have an interface called "Autocomplete" ?
RNGooglePlaces Only have methods which almostly are all Promise.

2019-01-14 18 43 42

@kidmysoul
Copy link
Author

kidmysoul commented Jan 14, 2019

OK, I reviewed my google api console again and found that Atmosphere Data and Contact Data Requests were not called by this library but a "javascript map http call"

and for native android sdk(just this library), it costs almost nothing(?).

this issue can be closed.

@tolu360
Copy link
Owner

tolu360 commented Mar 11, 2019

This has been added to the latest beta release, please see #198 to get started.

@tolu360 tolu360 closed this as completed Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants