pushex v0.0.1 Pushex.AppManager behaviour

Pushex.AppManager is used to retreive applications from their name.

By default, applications will be loaded from the configuration, but this behaviour can be implemented to get an app from a database for example.

Example

defmodule MyAppManager do
  @behaviour Pushex.AppManager

  def find_app(:gcm, name) do
    app = Repo.find_by(platform: gcm, name: name)
    %Pushex.GCM.App{name: name, auth_key: app.auth_key}
  end
end

Summary

Functions

find_app(platform, name)

Callbacks

find_app(platform, name)

Specs

find_app(platform :: atom, name :: String.t) :: Pushex.GCM.App