Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Abstracting Facebook API functions#78

Open
TomiS wants to merge 7 commits into
FriendsOfSymfony:masterfrom
Rohea:master
Open

Abstracting Facebook API functions#78
TomiS wants to merge 7 commits into
FriendsOfSymfony:masterfrom
Rohea:master

Conversation

@TomiS
Copy link
Copy Markdown

@TomiS TomiS commented Nov 18, 2011

No description provided.

@reisba
Copy link
Copy Markdown

reisba commented Nov 18, 2011

This abstracts the process of performing same basic tasks through Facebook API, such as retrieving user information and publishing posts as the user to user's own stream or as a Facebook page to a user controlled page. If there is interest to add this functionality to FOSFacebookBundle, pleaser feel free.

Justification would be that it is often a basic functionality that you use Facebook connectivity on a site for and it can be occasionally annoying and time consuming to follow the api changes of Facebook or learn how to do this functionality on your own. I'd find it easier to have it centralized in one place and if anything changes, you'll need to change your code only in one place (this bundle) and the developer would not necessarily need to know the specifics how the Fb api actually works.

How sending a message works is you create a container object for the message, call a service to handle the sending and order it to post the message. Example:

$streamPost = new fosStreamPost();
$streamPost->setMessage("Hello world");
// optional image
$streamPost->setAttachment("my image name", "caption text", "http://image_url...");
$facebookPush = $this->get("fos_facebook.facebook_push");
// send to user stream
$facebookPush->publishStream($streamPost);
// or facebook page
$facebookPush->publishPage($streamPost, "pageid");

Comment thread Services/facebookPush.php Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this should be FacebookPush

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants