Plugin: Notification

Create desktop notifications.

Entity Types

NamePropertyData TypeSocket Type
DesktopNotificationshowboolinput
app_namestringinput
summarystringinput
bodystringinput
iconstringinput
timeoutnumberinput

Platform Compatibility

PlatformCompatibilityNotes
Linuxhttps://github.com/hoodie/notify-rust#linuxbsd-support
MacOShttps://github.com/hoodie/notify-rust#macos-support
Windowshttps://github.com/hoodie/notify-rust#windows-support

Repository

NameRepository
inexor-rgf-plugin-notificationhttps://github.com/inexorgame/inexor-rgf-plugin-notification

Usage

GraphQL

Create Desktop Notification

mutation {
  instances {
    entities {
      create(
        type: "desktop_notification",
        id: "dfe30808-9242-4af8-aced-556ffe617038",
        properties: [
          {
            name: "show",
            value: false
          },
          {
            name: "body",
            value: "Test"
          }
        ]
      ) {
        id
        type {
          name
        }
        properties(
          names: [
            "show",
            "app_name",
            "summary",
            "body",
            "icon",
            "timeout"
          ]
        ) {
          name
          value
        }
      }
    }
  }
}

Show Desktop Notification

The property show=true triggers the notification.

mutation {
  instances {
    entities {
      update(
        id: "dfe30808-9242-4af8-aced-556ffe617038",
        properties: [
          {
            name: "show",
            value: true
          },
          {
            name: "summary",
            value: "Important Message"
          },
          {
            name: "body",
            value: "Lorem Ipsum"
          },
          {
            name: "icon",
            value: "computer"
          },
          {
            name: "timeout",
            value: 1000
          }
        ]
      ) {
        id
        type {
          name
        }
        properties(
          names: [
            "show",
            "app_name",
            "summary",
            "body",
            "icon",
            "timeout"
          ]
        ) {
          name
          value
        }
      }
    }
  }
}