fcmex v0.4.0 Fcmex.Util

Utils for Fcmex

Link to this section Summary

Functions

Parses the given FCM response.

Link to this section Functions

Link to this function

parse_result(arg)

Parses the given FCM response.

Examples

iex> Fcmex.Util.parse_result({:ok, %HTTPoison.Response{status_code: 200, body: "{\"a\": 1}"}})
{:ok, Poison.decode!("{\"a\": 1}")}

iex> Fcmex.Util.parse_result({:error, %HTTPoison.Error{id: 1, reason: "something goes wrong"}})
{:error, %HTTPoison.Error{id: 1, reason: "something goes wrong"}}