API リファレンス

Notifications

アクティブな通知を読み取ります。設定で NotificationListenerService を有効にする必要があります。

型定義

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
}

操作

query

notifications

現在アクティブなすべての通知を一覧表示します。

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

cancelNotifications

ID で 1 つ以上の通知を却下します。

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

replyNotification

inline-reply アクションを介して通知に返信を送信します。actionIndex は返信可能なアクションのうち 0 から始まるインデックスです。

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