API संदर्भ

Notifications

सक्रिय नोटिफिकेशन पढ़ें। settings में 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 अनुभाग के माध्यम से किसी नोटिफिकेशन को उत्तर भेजें। reply-capable अनुभागों में actionIndex 0-आधारित है।

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