Gmail加载项触发条件 [英] Gmail Add-on trigger criteria

查看:58
本文介绍了Gmail加载项触发条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以准确描述Gmail加载项脚本的触发条件吗?显然,每次用户在Gmail对话之间导航时,触发器不会被调用.

Can someone accurately describe the trigger criteria for Gmail Add-on scripts? Apparently, the trigger is not invoked each time the user navigates between Gmail conversations.

我能找到的唯一文档是 https://developers .google.com/gmail/add-ons/how-tos/building#note1 ,其中指出

The only documentation I can find is https://developers.google.com/gmail/add-ons/how-tos/building#note1, which states

唯一可用的上下文触发类型是无条件的,它将触发所有电子邮件,无论其内容如何.

the only contextual trigger type available is unconditional, which triggers for all emails regardless of content.

我将其解释为意味着每次用户导航到其他gmail对话时都会触发该触发器,但是事实并非如此:

I interpreted this to mean that the trigger is invoked every time the user navigates to a different gmail conversation, however, that is not the case:

我第一次导航到某些Gmail对话时,将触发附加触发器.当我使用较新"或较旧"尖括号按钮导航到另一个对话时,将再次为新对话调用触发器.但是,当我使用尖括号按钮将后退导航到首页时,附加触发器不会不会触发. (通过创建每个UI卡时显示时间戳,很容易显示这一点.)似乎正在进行某种内部缓存-有什么方法可以禁用它,或者以其他方式运行我的附加脚本时间用户在Gmail对话之间导航?

The first time I navigate to a some Gmail conversation, the add-on trigger fires. And when I navigate to another conversation using the the "Newer" or "Older" angle-bracket button, the trigger is again invoked for the new conversation. But when I navigate back to the first page using an angle bracket button, the add-on trigger does not fire. (Easy enough to show this by displaying a timestamp when each UI card is created.) There seems to be some kind of internal caching going on — is there any way to disable this, or otherwise run my add-on script each time the user navigates between Gmail conversations?

推荐答案

您可以使用ActionResponseBuilder.setStateChanged()清除缓存

you can use ActionResponseBuilder.setStateChanged(), to clear the cache

链接: https://developers.google.com/gmail /add-ons/how-tos/interactions

这篇关于Gmail加载项触发条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆