An Ecto type for storing, validating and generating Apple APNS Tokens
If available in Hex, the package can be installed
by adding ecto_apns_token
to your list of dependencies in mix.exs
:
def deps do
[{:ecto_apns_token, "~> 0.1.0"}]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ecto_apns_token.
As a Ecto Model field type
schema "devices" do
field :id, EctoApnsToken, required: true
end
Generating a random 64 character APNS token
EctoApnsToken.generate()
"8108f10c539f54d9e07471adbe3910802b135970f81da7dec740f65396f8f468"