Class Notification

Notificação

Notificação mostrada ao usuário como resposta à interação com um elemento da interface.

var action = CardService.newAction().setFunctionName("notificationCallback");
CardService.newTextButton().setText('Save').setOnClickAction(action);

// ...

function notificationCallback() {
  return CardService.newActionResponseBuilder()
      .setNotification(CardService.newNotification()
          .setText("Some info to display to user"))
      .build();
}

Métodos

MétodoTipo de retornoBreve descrição
setText(text)NotificationDefine o texto a ser exibido na notificação.

Documentação detalhada

setText(text)

Define o texto a ser exibido na notificação. Obrigatório.

Parâmetros

NomeTipoDescrição
textStringO texto da notificação.

Retorno

Notification: esse objeto para encadeamento.