Referencia de la API
Notificaciones
Lee las notificaciones activas. Requiere que NotificationListenerService esté habilitado en los ajustes.
Definiciones de tipos
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
}Operaciones
query
notifications
Lista todas las notificaciones activas en este momento.
bash
query GetNotifications {
notifications {
id onlyOnce isClearable appId appName time silent title body
actions replyActions
}
}mutation
cancelNotifications
Descarta una o más notificaciones por ID.
bash
mutation CancelNotifications($ids: [ID!]!) {
cancelNotifications(ids: $ids)
}mutation
replyNotification
Envía una respuesta a una notificación mediante una acción de respuesta integrada. actionIndex es de base 0 entre las acciones con capacidad de respuesta.
bash
mutation ReplyNotification($id: ID!, $actionIndex: Int!, $text: String!) {
replyNotification(id: $id, actionIndex: $actionIndex, text: $text)
}