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로 하나 이상의 알림을 닫습니다.

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)
}