问题
So I'm trying to implement a simple location autocompletion with the google places api. I'm using the autocomplete service for this (see: https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service).
What I'm doing right now is, creating an autocomplete token and renewing it if either 3 Minutes ran out (according to How long do the new Places API session tokens last?) or a place detail request was set (according to https://developers.google.com/places/web-service/session-tokens).
Now, I want to debug this and want to know if I did it properly.The dashboard on the google developer console counts every single request made though.
How do I know if it has an effect?|
回答1:
If you implemented session tokens correctly in your application, in your billing report within the Google Cloud Platform Console you should see one or both of the following SKUs:
Autocomplete without Places Details – Per Session
Autocomplete (included with Places Details) – Per Session
If you didn't, you'll see this instead:
Autocomplete – Per Request
Note that this only applies if you use getPlacePredictions()
. There are no session tokens for getQueryPredictions()
.
Hope this helps!
来源:https://stackoverflow.com/questions/59222225/how-to-know-if-sessiontoken-was-implemented-properly