Elixir wrapper of OneSignal
If available in Hex, the package can be installed as:
- Add one_signal to your list of dependencies in
mix.exs
:
def deps do
[{:one_signal, "~> 0.0.6"}]
end
- Ensure one_signal is started before your application:
def application do
[applications: [:one_signal]]
end
- Puts config your
config.exs
config :one_signal, OneSignal,
api_key: "your api key",
app_id: "your app id",
import OneSignal.Param
OneSignal.new
|> put_heading("Welcome!")
|> put_message(:en, "Hello")
|> put_message(:ja, "はろー")
|> put_segment("Free Players")
|> put_segment("New Players")
|> notify