0

We have Gmail Workspace add-on that is used on both the Gmail Web app and Gmail Mobile app.

For some reason when running in the Gmail Mobile app there is no back navigation available. The below screen shot shows the navigation on the Web app.

enter image description here

But this is not available on the Mobile app?

enter image description here

I can't see this difference documented anywhere. Is there something we are not setting to enable this?

Also in addition to the back navigation not being available we get an error whenever we try and set the navigation via app script.

For example the following:

cs.newActionResponseBuilder().setNavigation(cs.newNavigation().popCard()).build()

gives the error on Mobile app only -

failed to complete your action because the add-on will be in a bad state

enter image description here

Is this behaviour to be expected? Is there some other approach to controlling navigation on Gmail Mobile that we are not aware of?

4

1 回答 1

1

我发现了问题......以防其他人遇到它。

在我的代码中 - 当调用的函数返回卡片时会导致问题,如下面的代码片段所示

function loadStackCard() {
  var emailCard = CardService.newCardBuilder().setHeader(CardService.newCardHeader().setTitle('STACK CARD'))
    .addSection(CardService.newCardSection().addWidget(CardService.newTextButton().setText('GO BACK')
    .setOnClickAction(CardService.newAction().setFunctionName('goBack')))).build();         
    return emailCard;
}

但是当我将卡片推到导航堆栈上时,它可以在移动设备上运行

function loadStackCard() {
  var emailCard = CardService.newCardBuilder().setHeader(CardService.newCardHeader().setTitle('STACK CARD'))
    .addSection(CardService.newCardSection().addWidget(CardService.newTextButton().setText('GO BACK')
    .setOnClickAction(CardService.newAction().setFunctionName('goBack')))).build(); 
    nav = CardService.newNavigation().pushCard(emailCard) ;
    return CardService.newActionResponseBuilder().setNavigation(nav).build();
}
于 2021-02-18T23:50:27.727 回答