Push Notifications - Infomaker/Dashboard-Plugin GitHub Wiki

Push Notifications

Version: 1.0.0

Description

Push Notifications is a Dashboard plugin replaces the push-interface push-in interface in Epaper admin, but emphasized under the demons, it can be used both with and without epaper-coupling and even with and without OC-connection.

Installing

in your dashboard go to > plugins > install plugin >

  • Prod: https://plugins-prod.s3.amazonaws.com/se-infomaker-dashboard-push-notifications/v1
  • Stage: https://plugins-stage.s3.amazonaws.com/se-infomaker-dashboard-push-notifications/v1

Optional plugins

LCC Agent

Example Configuration with a fictional app called Foo

Configuration

{
  "push": {
    "url": "https://jz9y437ck3.execute-api.eu-west-1.amazonaws.com/dev",
    "key": "QjPs8D99Yh3KlQ8CiJ4lC7u5DemGAptR7Nj7X23m"
  },
  "content": {
    "provider": "foo-test",
    "queries": {
      "article": {
        "headline": "/nm:newsItem/nm:contentMeta/inl:metadata/inl:object[@type=\"x-im/teaser\"]/@title",
        "body": "/nm:newsItem/nm:contentMeta/inl:metadata/inl:object[@type=\"x-im/teaser\"]/inl:data/inl:text/text()"
      },
      "package": {
        "headline":  "/package/name/text()",
        "publishAt":  "/package/pubStart/text()"
      }
    }
  },
  "apps": [
       {
      "id": "foo",
      "name": "Foo App",
      "topic": "bc123456-0666-0777-ba89-0ed1f23f456b",
      "contexts": [
          {"name": "Nyheter", "id": "nyheter"},
          {"name":"Utgåvor","id":"utgavor"}
      ],
     "contextDefaults":  {
        "message": "nyheter",
        "article": "nyheter",
        "package": "utgavor"
      }
    }
  ]
}

Explanation

"push": {
  "url": "https://jz9y437ck3.execute-api.eu-west-1.amazonaws.com/dev"
  "key": "QjPs8D99Yh3KlQ8CiJ4lC7u5DemGAptR7Nj7X23m"
}

the url and api key, to the remote api doing the actual work, should end with either /dev /stage /prod, depending on which environment you are in.

"content": {
  "provider": "foo-test",
  "queries": {
    "article": {
      "headline": "/nm:newsItem/nm:contentMeta/inl:metadata/inl:object[@type=\"x-im/teaser\"]/@title",
      "body": "/nm:newsItem/nm:contentMeta/inl:metadata/inl:object[@type=\"x-im/teaser\"]/inl:data/inl:text/text()"
    },
    "package": {
      "headline":  "/package/name/text()",
      "publishAt":  "/package/pubStart/text()"
    }
  }
}

this part is where the (optional) connection to open content is provided, the provider is the lcc name of the oc configuration. The queries are used to automatically fill data when drag and dropping articles/packages (when new pushes are made).

"apps": [
  {
    "id": "foo",
    "name": "Foo App",
    "topic": "bc123456-0666-0777-ba89-0ed1f23f456b",
    "contexts": [
        {"name": "Nyheter", "id": "nyheter"},
        {"name":"Utgåvor","id":"utgavor"}
    ],
    "contextDefaults":  {
      "message": "nyheter",
      "article": "nyheter",
      "package": "utgavor"
    }
  }
]

this section is where one or more apps must be configured. id is a unique short name for the app, and name is the name that will be visible in the interface. topic is a uuid (that needs to be created and stored inside the push admin database). contexts are the different modules which the app may contain. contextDefaults are used to be able to default to different contexts when using drag and drop for articles and packages.