pushex v0.2.0 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