API-Referenz

Benachrichtigungen

Aktive Benachrichtigungen lesen. Erfordert, dass NotificationListenerService in den Einstellungen aktiviert ist.

Typdefinitionen

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
}

Operationen

query

notifications

Alle aktuell aktiven Benachrichtigungen auflisten.

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

cancelNotifications

Eine oder mehrere Benachrichtigungen anhand der ID verwerfen.

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

replyNotification

Auf eine Benachrichtigung über eine Inline-Antwort-Aktion antworten. actionIndex ist 0-basiert unter den antwortfähigen Aktionen.

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