Class ActionResponse

ActionResponse

Đối tượng phản hồi có thể được trả về từ hàm callback (ví dụ: trình xử lý phản hồi biểu mẫu) để thực hiện một hoặc nhiều hành động trên ứng dụng. Một số tổ hợp hành động không được hỗ trợ.

// 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();

Phương thức

Phương thứcKiểu dữ liệu trả vềMô tả ngắn
printJson()StringIn đại diện JSON của đối tượng này.

Tài liệu chi tiết

printJson()

In đại diện JSON của đối tượng này. Thao tác này chỉ dùng để gỡ lỗi.

Cầu thủ trả bóng

String