Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions lib/facebook.ex
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,23 @@ defmodule Facebook do
|> GraphAPI.post("", [], params: params)
|> ResponseFormatter.format_response
end
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you call the new publish from this function now? Or rather, is it even needed now that the generic publish is here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good point! I think it could be used here too. It can also safely be removed, what do you think? The only difference is in the type of first parameter which can anyway be a symbol indeed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mweibel can you help in understanding why the build is failing please?

@doc """
Publish to a generic Facebook Graph edge.

## Examples
iex> # create a Facebook Campaign
iex> Facebook.publish(:campaigns, "act_1234546", [objective: "LINK_CLICKS", name: "a campaign"], "<Access Token>")
{:ok, %{"id" => "{campaign_id}"}}
"""
@spec publish(edge :: String.t, parent_id :: String.t, params, access_token) :: resp
def publish(edge, parent_id, params, access_token) do
params = params
|> add_access_token(access_token)

~s(/#{parent_id}/#{edge})
|> GraphAPI.post("", [], params: params)
|> ResponseFormatter.format_response
end

@doc """
Publish media to a feed. Author (user or page) is determined from the supplied token.
Expand Down