如何知道sessionToken是否正确实现? [英] How to know if sessionToken was implemented properly?
问题描述
所以我正在尝试使用Google Places API实现简单的位置自动补全.我为此使用了自动完成服务(请参阅: https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service ).
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).
我现在正在做的是创建一个自动完成令牌,并在3分钟内都用完时更新它(根据 https://developers.google.com/places/web-service/session-tokens )
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).
现在,我想调试一下并想知道我是否做得正确.尽管如此,Google开发人员控制台上的信息中心仍会统计每个请求.
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?|
推荐答案
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
请注意,这仅在使用getPlacePredictions()
时适用. getQueryPredictions()
没有会话令牌.
Note that this only applies if you use getPlacePredictions()
. There are no session tokens for getQueryPredictions()
.
希望这会有所帮助!
这篇关于如何知道sessionToken是否正确实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!