Most of the examples and tutorials I have found for the Facebook SDK are for publishing to user accounts.
As someone who has used the Facebook PHP SDK but not the Javascript SDK, I can't find an example or tutorial for the following:
User clicks FB connect button
Popup window shows manageable Fan Pages
User chooses a Page which they'd like my website to manage
My website gets the ID of the chosen Page
With my website I'm not looking to post information to the admin's Fan Page, but rather just get the ID of the Page they want to use with my site. Thanks to the PHP SDK, I already have a method of pulling all the information from the admin's Fan Page that I need.
Is there such a guide?
You can use the graph to get '/me/accounts' which will list all of the apps/pages that the user administrates. You will need to create your own selection pop up for step 2 and 3, using the data from the response object as the values to submit back to your site in step 4.
Try something like this:
FB.login(function (response){
FB.api('/me/accounts',function(apiresponse){
var data=apiresponse['data'];
var ids = new Array();
for(var i=0; i<data.length; i++){
ids[i]=data[i].id;
}
console.log(ids);
});
},{scope:'manage_pages'});
Related
I'm developing an app for iPhone(ios5), where I need the information of the posts I made highlighted in my facebook profile. Using facebook-graph api its possible to get all the data of user profile but is there any way I can get highlighted posts data ? For example I want to count and keep track of how many posts I highlighted in fb timeline.
You can use [pageid]?fields=posts.fields(timeline_visibility)
Each highlighted post will have timeline_visibility set to "starred"
I'm creating a web app where I'd like to 1) upload a photo to an app-specific album on Facebook and then 2) share that photo as a LARGE item/image (not a thumbnail) on the users' Timeline. I know this is doable via User Generated Photo optional parameter but is there any other way to accomplish this for a web app?
There is nothing stopping web apps from publishing Open Graph actions with User Generated Photos. It's a simple process:
Setup Facebook auth on your site, your simplest option being to use the Javascript SDK with getLoginStatus. Make sure to request publish_actions permission from users.
Create an Open Graph action and your OG object types
When the user takes the appropriate action, make an API call of the following form (signed with the user access token and POST'd):
https://graph.facebook.com/me/YOUR_APP_NAMESPACE:YOUR_APP_ACTION?
YOUR_OBJECT_TYPE=YOUR_OBJECT_URL&
image[0][url]=YOUR_PHOTO_URL&
image[0][user_generated]=true
Step 1 is the hardest part and you'd have to do that anyway if you weren't going down the Open Graph actions route.
As an example, Instagram use took as their action and a photo as their object. Their objects URLs are simply the individual photo pages on the Instagram website. So their API POST call would look like this:
https://graph.facebook.com/me/instagram:took?
photo=http://instagram.com/p/ABCD1234/&
image[0][url]=http://distilleryimage.instagram.com/somerandomstring.jpg&
image[0][user_generated]=true
As mentioned in the User Generated Photos documentation this will show up as a large, full-width photo on the users Timeline and feed.
The simplest way to perform all these API calls from a web app is to use the Javascript SDK and the FB.api function. You won't need to use any server-side code at all in that case!
Just fill this code on your photo caption
"took a ##[0:[124024574287414:1:photo]] with #[124024574287414:0]"
(without double quote symbol)
It clickable to instagram website, It's my own custom code, I made it for a week :(
I created a site and added a Facebook like button to it. Weeks later I realised that I would also like to have a Facebook page for the site. Good enough, except that when I create the FB page, it has its own Like count and its at 0. Is there anyway to integrate the existing like button with the new page?
URL likes and Facebook PAGE like are different things. So, I don't think its possible to migrate your URL likes to your FB Page.
I have a very basic website with the potential for having hundreds of pages, and would like to have a the Facebook Like button on each one.
However, before I do it, I would like to know the difference between inserting the Like button with, or WITHOUT using Open Graph META tags.
I don't want each page that visitors 'Like' to become their own Facebook pages, but I WOULD like their 'Like' to show up on their wall so their friends can see it.
Is the only real reason for using Open Graph to specify what exactly it is that you want to show up in the message and 'Like' post?? (example: 'Dave likes The Rock - IMDB' with a picture of the movie and a description underneath.)
#Vali What you are suggesting:-
Including Open Graph tags on your Web page, makes your page equivalent to a Facebook Page. This means when a user clicks a Like button on your page, a connection is made between your page and the user. Your page will appear in the "Likes and Interests" section of the user's profile, and you have the ability to publish updates to the user.
is not possible. Kindly see my similar question:
Convert my Site to Facebook Graph Object
As you said you can add a Like button without OpenGraph. That's the easy way and with that you don't have any future connection with the person who liked your link/page.
Including Open Graph tags on your Web page, makes your page equivalent to a Facebook Page. This means when a user clicks a Like button on your page, a connection is made between your page and the user. Your page will appear in the "Likes and Interests" section of the user's profile, and you have the ability to publish updates to the user.
Using Open Graph you have a greater control on what you want to appear on that person's wall.
Open Graph is still beta. If you want to use OpenGraph you need to create a FB app, get the APP ID and add it to your webpage. If you want to use the simple Like button, you just add the fb:like tag and that's all.
don't want each page that visitors 'Like' to become their own Facebook pages
This will not happen. You're the single admin of your page.
Is the only real reason for using Open Graph to specify what exactly it is that you want to show up in the message and 'Like' post??
Yes, you can do this with Open Graph. I suggest using Open Graph if you want to post enhanced wall posts and if you want to get connected with the users who likes your page.
I want to have a likebox plugin for my own URL (not a Facebook Page URL)
E.g.
http://www.example.com/product1.html
http://www.example.com/product2.html
I already have opengraph meta data, and user are able to like it, but I want to have likebox kind of plugin showing user faces...is it possible?
Facebook says the Facebook Like Box is only for Facebook pages. You could generate a like button with a show faces option for your website though.