Packages

Simple Elixir wrapper for Facebook's Send API

Current section

Files

Jump to
xend lib xend base_in_memory.ex
Raw

lib/xend/base_in_memory.ex

defmodule Xend.BaseInMemory do
@moduledoc false
def post(body) do
case body do
%{recipient: %{id: id}, message: %{text: _}, notification_type: _} ->
%{recipient_id: id, message_id: "12345"}
%{recipient: %{id: id}, message: %{attachment: %{}}, notification_type: _} ->
%{recipient_id: id, message_id: "12345", attachment_id: "ANYID"}
%{recipient: %{id: id}, sender_action: _} ->
%{recipient_id: id, message_id: "12345"}
_ -> {400, %{error: %{}}}
end
end
end