-
Notifications
You must be signed in to change notification settings - Fork 290
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
[Feature] Support session tokens #262
base: master
Are you sure you want to change the base?
[Feature] Support session tokens #262
Conversation
Is there any news on this? |
I can finally see the prices going down again after publishing my app with the changes in this pull request. We went through 5 months of turmoil with expenses exceeding 4k USD a month and I'm sure more people will go through the same if they don't become aware of how important session tokens are. Additionally, here's a tip if you're after this feature but cant wait for this pull request to be approved. You can add a specific pull request as a dependency of your project: "react-native-google-places": "#262/head" |
Hi @rodperottoni, this looks well put together I must say. I am sorry I have been away and just looking at this. I am working on releasing a v4, a week from now, at the latest. Thank you for your contributions. |
@rodperottoni I don't think it is working. I tried from your fork. |
Hey Akshay. The images above show the exact opposite. After I started using session tokens our monthly bill went down significantly. |
The number of requests in the maps console is the same as the number of keystrokes that I make in the search bar (when the sessiontoken is set even after executing |
I think you're not understanding what an In other words, a session token tells Google that calls using the same token should be grouped and charged as ONE PRODUCT. With that said, It's up to you to throttle or debounce your calls to |
Hello, Thanks for the contributions and the great library. Is there any update for v4 or merging this with the master branch? |
@tolu360 We really need this PR work. Can you please let us know what can be the ETA of merging this? |
One of the apps I currently maintain has been severely affected by the Places API price changes introduced this year. Overnight my client saw his Google Places bill increase by ~10x, and upon investigating a bit further I came to the conclusion that the lack of support for session tokens on this module was the cause for this price increase. I do not use the provided Autocomplete Modal, so I'm not the right person to tell whether it correctly uses session tokens or not. This pull request only addresses the scenario where an app is making multiple
getAutocompletePredictions
calls, optionally followed by alookUpPlaceByID
call.This pull request fixes this issue by exposing a new function named
beginAutocompleteSession
that generates a new Session Token on the module's class instance. Further calls togetAutocompletePredictions
andlookUpPlaceByID
will then use this Session Token. There's also a new functioncancelAutocompleteSession
that does the opposite - cleans up any session tokens being kept on the module's class instance.I'm keen to discuss better ways to implement this as well.
Read more:
Places API - Session Tokens
SKU: Autocomplete (included with Places Details) – Per Session