Référence de l'API
Notifications
Lit les notifications actives. Requiert que NotificationListenerService soit activé dans les paramètres.
Définitions de types
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
}Opérations
query
notifications
Liste toutes les notifications actuellement actives.
bash
query GetNotifications {
notifications {
id onlyOnce isClearable appId appName time silent title body
actions replyActions
}
}mutation
cancelNotifications
Rejette une ou plusieurs notifications par ID.
bash
mutation CancelNotifications($ids: [ID!]!) {
cancelNotifications(ids: $ids)
}mutation
replyNotification
Envoie une réponse à une notification via une action de réponse intégrée. actionIndex est basé sur 0 parmi les actions capables de répondre.
bash
mutation ReplyNotification($id: ID!, $actionIndex: Int!, $text: String!) {
replyNotification(id: $id, actionIndex: $actionIndex, text: $text)
}