Chime.Channels.Push (Chime v0.1.0-dev)

Copy Markdown View Source

The :push channel: a notification on a person's devices, browsers by Web Push, Apple's by APNs, Android's by FCM, with the services of the config's :push (see the Push guide).

What it says is the notifier's push/3 when it has one, else what the feed shows:

def push(data, _recipient, notification) do
  %{
    title: "#{Chime.actors(notification)} commented",
    body: data["text"],
    url: "/stories/#{data["story_id"]}",
    image: data["cover"],
    icon: "/icon-192.png",
    badge: "/badge-72.png"
  }
end

Chime adds:

  • the link that opens the notification and reads it in the feed (Chime.link/2), from :url;
  • the tag of the notification's group (or its id): a newer push of the group replaces the one on the device, on every service;
  • the notification's id.

It goes to every device of the person that is turned on. A device a service says is gone is forgotten, and the log says so. A push that reaches one device or more is sent; one that fails on every device is tried again.