Can you allow a user to REPLY to a card and not have a card appear with their response text in the timeline?

隐身守侯 提交于 2019-12-23 09:39:31

问题


When I have a bundle (perhaps this also occurs with a single timeline card) with a REPLY action and the user executes that action, with lets say "peanut butter and jelly sandwich", a new timeline card appears with white text on a black background on Glass with the text "peanut butter and jelly sandwich". When looking at the playground that same card appears with the user's avatar on the left (like the Abe Lincoln template example), and the text on the right.

Lets call this new card the reminder card, as it reminds the user what text they spoke and allowed to be sent.

I did not insert that reminder card into the timeline.

Is this default Glass behavior for the REPLY action to insert a reminder to the user that they spoke some text? Does this count against our API tally, or is it a freebie and charged against some Google account?

Is there a way to use the REPLY action and apply some kind of undocumented attribute to prevent the display of this reminder card?

There is this documentation here which seems to encourage non-repeated REPLY actions, which could be motivated by this reminder card behavior.

REPLY, REPLY_ALL - Voice replies are intended to capture free form input by voice. Do not use voice replies to capture a limited set of options, such as possible moves in a game.

Source

Here is code to reproduce the problem in Java, nothing complicated:

menuItemList.add(new MenuItem().setAction("REPLY"));

回答1:


The "REPLY" timeline item is automatically inserted by the Glass client and its ownership is set to your Glassware: this means that you have full read/write access to this timeline item.

It is up to your Glassware to process the timeline item and apply some styling. The timeline item is also useful for the user as it lets the user "DELETE" the reply if necessary. If deleting the reply does not make sense in your Glassware, feel free to delete the timeline item when processed to remove it from the user's timeline.

Regarding API quota, this is only counted when you send an actual request to the API like retrieving the timeline item. Glass creating the "REPLY" does not consume your quota.




回答2:


Standard practice is for your Glassware to either UPDATE the reply after you process it, or to DELETE the reply if it is no longer required. Either may make sense depending on the exact context of how the reply is handled. It may even make sense to add this existing reply to another bundle that you control.

As Alain noted, there is no quota on the number of cards that exist - just on the number of operations that you do. This isn't an operation that you take, so it doesn't count against the quota.

Finally, although not completely related, it is worth noting that this also happens when you SHARE a card - a copy of the card is made and you're permitted to that new card. Your application may take any actions on this new card that you wish.




回答3:


Actually (at least in my opinion) the main reason for the card being there is that so your application can access the text somewhere. Replying won't add any extra information to the original card but create the new card with the text of the reply, and the itemId of this card will be send in a notification to your subscription.

What you could do is to delete the card once you receive the notification and handled the reply. The card is completely in your control so you can manipulate however you like.



来源:https://stackoverflow.com/questions/17218159/can-you-allow-a-user-to-reply-to-a-card-and-not-have-a-card-appear-with-their-re

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!