Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Hajto/ExFCM
ExFCM is a simple wrapper around Firebase Cloud Messaging
https://github.com/Hajto/ExFCM
Last synced: 2 months ago
JSON representation
ExFCM is a simple wrapper around Firebase Cloud Messaging
- Host: GitHub
- URL: https://github.com/Hajto/ExFCM
- Owner: Hajto
- Created: 2016-10-04T20:22:52.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-05T06:49:37.000Z (over 8 years ago)
- Last Synced: 2024-07-05T16:44:05.718Z (6 months ago)
- Language: Elixir
- Homepage: https://hex.pm/packages/exfcm
- Size: 7.81 KB
- Stars: 1
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Simple wrapper for posting Firebase Cloud Messages. (Miscellaneous)
- fucking-awesome-elixir - exfcm - Simple wrapper for posting Firebase Cloud Messages. (Miscellaneous)
- awesome-elixir - exfcm - Simple wrapper for posting Firebase Cloud Messages. (Miscellaneous)
README
# ExFCM
Is a simple wrapper around Firebase Cloud Messaging that uses HTTPoison.
## Needed configuration
```elixir
config :exfcm,
server_key: "yourKeyFromConsole"```
## To send message to topic
```elixir
{:ok , result } = Message.put_data(%{"sample" => "true"})
|> Message.put_notification("Github","is_awesome")
|> Message.target_topic("aTopic")
|> Message.send
```## To send message to device or device group
```elixir
{:ok , result } = Message.put_data(%{"sample" => "true"})
|> Message.put_notification("Github","is_awesome")
|> Message.target_device("aTopic")
|> Message.send
```## Installation
If [available in Hex](https://hex.pm/packages/exfcm), the package can be installed as:
1. Add `exfcm` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:exfcm, "~> 0.1.0"}]
end
```2. Ensure `exfcm` is started before your application:
```elixir
def application do
[applications: [:exfcm]]
end
```
## TODO* Add custom filters
* Add suport for additional params on notification