Skip to content

Releases: stepnivlk/pushest

Fix Api gun response handling & cleanup

20 Apr 08:22
0999464
Compare
Choose a tag to compare
  • Fix an issue in handle_info clause responsible for awaiting to the response body.
  • Clean unused types.
  • Add gen_server structural comments.

Add init_channels/0 function

16 Apr 22:38
7e0e662
Compare
Choose a tag to compare

init_channels/0 allows to subscribe to given list of channels during the startup of your app.

Example:

defmodule SimpleClient do
  use Pushest, otp_app: :simple_client

  def init_channels do
    [
      [name: "public-init-channel", user_data: %{}],
      [name: "private-init-channel", user_data: %{}],
      [name: "presence-init-channel", user_data: %{user_id: 123}],
    ]
  end
end

Each element of the list has to be a keyword list with name and user_data keys with values of following type: [name: String.t(), user_data: map]