I was wondering what are Facebook limitations. My client wants 开发者_JS百科such project:
App allows user to post photo on their facebook page and share it with their friends with a message.
Can Facebook API allow all these steps to be accomplished?
Yes, API provides it via REST
:
http://developers.facebook.com/docs/reference/rest/photos.upload - to upload a photo http://developers.facebook.com/docs/reference/rest/stream.publish - to publish it on the user's wall
Or the same with Graph
:
http://developers.facebook.com/docs/reference/api/photo
http://developers.facebook.com/docs/reference/api/post
Facebook provides JS and other multiple SDKs for this, you can use the following js code for reference.
FB.api('/'+page_id+"/feed/", 'post',{"privacy":"{'value':'EVERYONE','description':'visible to everyone'}","access_token":access_token,
message: title + " " + description,
picture: image,
from: 'me',
caption: caption,
link: photo_click_link,
description: description
}, function(response) {
if (!response || response.error) {
access_token ="";
get_access_token();
show_custom_message(response["error"]);
} else {
update_ad_share_url_and_status(id, response.id,"page");
}
});
where page_id is the id of the page
you can use the following privacy parameters to set privacy
When value is CUSTOM, this is a comma-separated list of user IDs and friend list IDs that can see the post. This can also be ALL_FRIENDS or FRIENDS_OF_FRIENDS to include all members of those sets.
yes facebook api allow this , but your facebook app must take approval from facebook . You must submit a request with your application details like website url and screen shoot after approval you are getting the public photos of your time line
精彩评论