Referência da API

Notificações

Leia notificações ativas. Requer que NotificationListenerService esteja ativado nas configurações.

Definições de Tipo

bash
type Notification {
  id: ID!
  onlyOnce: Boolean!       # "persistent" notification flag
  isClearable: Boolean!
  appId: String!           # package name
  appName: String!
  time: String!            # ISO 8601
  silent: Boolean!
  title: String!
  body: String!
  actions: [String!]!      # action button labels
  replyActions: [String!]! # labels of inline-reply actions
}

Operações

query

notifications

Liste todas as notificações ativas no momento.

bash
query GetNotifications {
  notifications {
    id onlyOnce isClearable appId appName time silent title body
    actions replyActions
  }
}
mutation

cancelNotifications

Dispense uma ou mais notificações por ID.

bash
mutation CancelNotifications($ids: [ID!]!) {
  cancelNotifications(ids: $ids)
}
mutation

replyNotification

Envie uma resposta a uma notificação por meio de uma ação de resposta inline. actionIndex é baseado em 0 entre as ações com capacidade de resposta.

bash
mutation ReplyNotification($id: ID!, $actionIndex: Int!, $text: String!) {
  replyNotification(id: $id, actionIndex: $actionIndex, text: $text)
}