Class ActionResponse

ActionResponse

回呼函式 (例如表單回應處理常式) 可能會傳回的回應物件,以在用戶端執行一或多項動作。系統不支援某些動作組合。

// An action that opens a link
var actionResponse = CardService.newActionResponseBuilder()
    .setOpenLink(CardService.newOpenLink()
        .setUrl("https://www.google.com"))
    .build();

// An action that shows a notification.
var actionResponse = CardService.newActionResponseBuilder()
    .setNotification(CardService.newNotification()
        .setText("Some info to display to user"))
    .build();

// An action that shows an additional card. It also sets a flag to indicate that the original
// state data has changed.

var cardBuilder = CardService.newCardBuilder();
// Build card ...
var actionResponse = CardService.newActionResponseBuilder()
    .setNavigation(CardService.newNavigation()
        .pushCard(cardBuilder.build()))
    .setStateChanged(true)
    .build();

方法

方法傳回類型簡短說明
printJson()String列印此物件的 JSON 表示法。

內容詳盡的說明文件

printJson()

列印此物件的 JSON 表示法。這項資訊僅適用於偵錯。

回攻員

String