status page empty - facebook-apps

I'm trying to display my Facebook status on my personal website. I tried this great tutorial http://johndoesdesign.com/blog/2011/php/adding-a-facebook-news-status-feed-to-a-website
The code work great for a couple of Facebook page that I own. But for a specific FB Page I get to step 4 and then get nothing.
{
“data”: [
]
}
Not sure what I’m doing wrong? Any thoughts
The Facebook Page is http://facebook.com/KINGDOM.Gentlemans.Club
(remove space after http://)
The Facebook Page_ID is
114357805248420
Example
https://graph.facebook.com/114357805248420/feed?access_token=???????
Does someone know why I get a blank data page?
Thank you
Marc

I can't find your page on Facebook (over 21 from the USA), so your problem is one of two things:
Your ID and page username are wrong. I should be able to see your page at facebook.com/USERNAME or facebook.com/PAGE_OR_USER_ID. I can't see it at either of these from the information in your original post.
You've got country and/or age restrictions on your page. If that's the case, your generic App access token isn't going to work. To show the feed of a restricted page on a website, Facebook requires you use the access token of a user who has permission to see your page. This prevents your restricted content from being shown to people who shouldn't be looking at it. If you don't have any restrictions on your site, then you don't need an access token to view the results.
BTW, don't EVER post real access tokens on SO. Anyone can harvest and use them. You should reset your KingomFeed app access token NOW.

Related

facebook app: permissions request gives blank page

This is my first post on StackOverflow.
I've been trying to start a facebook app but I had some trouble granting permissions. When I use the example provided on the facebook documentation, it works as expected with the developper's account but not with another account. Using another account, I can enter my credentials but then, instead of a page requesting for permissions, I see a blank page.
Any idea what can be the problem ? I have tried to add a Site-URL in my app's settings but I couldn't make it work so far..
Thanks !
I am trying to figure this one out as well, your question helped since you mentioned that is did work for the developer's account. I tried and added a tester accounts on https://developers.facebook.com/apps/{your app-id}/dashboard/and they work too..
EDIT:
I found the answer thanks to you. See: The developers of this app have not set up this app properly for Facebook Login?

Using the Login Button plugin to get fb userid BEFORE user Authenticates

So when you put the login button plugin on an app it seems to display the user's friends that are using said app. It displays this even to users that have NOT allowed the app access yet. For example, if you go to "Henry's Cooking App" but have never Logged into the app thru facebook, it will still show you your friends that are using the app.
What I'm trying to do is use this feature to grab an array of fb-userids from the plugin so I can do a query on my DB to show the POTENTIAL user a little more info. For example let's say you have 2 friends that already use "Henry's Cooking App": Joe and Karen. If I could get their userid I could then show you something like "Joe just cooked Veal Scallopini, and Karen is perfecting her Tonkatsu Curry".
I know you could do this easily IF you had the authentication token, but that is only obtained after the user logs in. I'm trying to leverage the fact that fb seems to think it's OK to show your friends that are using the app BEFORE you sign up for the app.
The only super hacky way I could think of to do it is the fact that I could pull the href attribute of elements matching $(".uiFacePileItem a") which gives a link to the user profile which I could then grab the username or UID from. This seems like it could break easily though, anyone have a better idea? Thanks!
The only super hacky way I could think of to do it is the fact that I could pull the href attribute of elements matching $(".uiFacePileItem a") which gives a link to the user profile which I could then grab the username or UID from.
You can’t do that, because the Facebook login dialogs are not running under your domain – so the Same Origin Policy prevents you from interacting with the DOM of these dialogs.
I'm trying to leverage the fact that fb seems to think it's OK to show your friends that are using the app BEFORE you sign up for the app.
Well, it’s certainly (more) OK if Facebook does that – because that doesn’t give any information away to third parties (meaning you as the app developer/provider) – only the user sees that.
It would not be OK if Facebook would let you access this info, at a point where I haven’t even decided to use your app yet – totally a case of „none of your business”.
After I decide to use your app, you may have access to certain information. Before that – No Way, José.

Using Graph API to post to fan page as the fan page (not as a user)

Need help. I have Graph API code that uses an auth token with offline permissions to post to a fan page as me. I can't seem to figure out how to get it to post to a fan page as the fan page. The API Explorer only works as an individual. When I do a "use facebook as..." for the page and try to use the explorer, it tells me it has to revert me back to being me first. So the auth token is for my personal account, not the fan page account. The auth token has the manage_pages permissions, but that just lets me post to the page as me.
Anyone have an answer or know where I can find one? Search on FB, Bing, Google all pull up nothing on this specific issue.
The point being, of course, that while I could have the automation post as me, that means that the post doesn't show as being from the page, so most people won't see it. Need adult supervision! ;)
Check out the authentication documentation under the title App Login. All the information you need is there...
You have to request an access token for the page and not for the user - then all post you make are onbehalf of the page.
https://graph.facebook.com/oauth/access_token?
client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&
grant_type=client_credentials
Fetching that url will give you the correct access token to post as your page.
To post to fanpage u not only need a manage page permission but the most importantly u need a page access token,here's the code for getting page access token.
$pages_arr = array(
'access_token'=>$access_token ,
'fields'=>'access_token'
);
// Get Page access_token
$page_token = $fb->api('/'.$pageid, 'get',$pages_arr);
$page_access_token=$page_token['access_token']; // get page access_token
// you got the page access token,now use it to do anything on page as page
See my blog post "how to post TO a page and AS the page" at http://bobbelderbos.com/2011/11/facebook-api-post-to-page-and-as-page/
Once you have the manage_pages permission each page requires its own access code.
See the blog post for further explanation, demo and code download.

Getting Facebook Authenticated Referrals from "Likes"

We're trying to use the Facebook Authenticated Referrals feature on our website.
Right now it works fine when one user (Alice) uses a Feed Dialog to post to her wall and another user (Bob) clicks on Alice's post. Bob sees an Auth Dialog before navigating to our website.
But our app doesn't (currently) use Feed Dialogs; we just have Like buttons everywhere. I was hoping/expecting that when Alice clicks the Like button in an article on our site, and Bob clicks on Alice's "Like" post, Bob would get an Auth Dialog.
Am I just misconfiguring my site/app somehow? Is it possible to get Authenticated Referrals from Likes at all?
I didn't realise this was potentially possible - I assumed it would work if the liked URLs were all http://apps.facebook.com/{YOUR NAMESPACE}/ URLs - if this isn't working it sounds like either a bug or a fairly reasonable feature request.
If the likes are to URLs outside of your Canvas URL I wouldn't really expect this to work, because the links are not definitely associated with your canvas app
«If you need access to more information, such as the user's email address, etc. you must request permissions for this information. If you can do this by adding the permissions you need to the scope attribute of the Login Button like below»
http://developers.facebook.com/docs/guides/web/
Check the link, I've waste enough time but still not understand, why should we ask grant permission for our application twice — in App Settings first and <div class="fb-login-button" data-scope="read_stram, offline_access"> here is the second one. Just check your data-scope attribute.
<fb:login-button> attribute is scope, you can read a bit about it by the link below.
http://developers.facebook.com/docs/reference/plugins/login/
In a Facebook bug, a FB engineer responded to say: "this is currently the design of authenticated referrals. It only happens with Open Graph app publishes."
So, at least for now, no authenticated referrals are possible for Facebook Like links.

visiting users Facebook ID w/out authorization?

I have a native (FBML) Facebook Application. I do not want to push the application visitors through the authorization process, however I do want to know their Facebook ID.
Is it possible to find the visiting users Facebook ID without requiring them to "Authorize" my Application?
Before, I said it couldn't be done - but it can.
http://developers.facebook.com/docs/authentication/canvas
Read that, it's excellent. You need to decode the Base64 string and check the signature is correct, but other than that it gets you the user id among other stuff (like a temporary access token for graph.facebook.com)
REMEMBER : You need to change the settings in the Migrations tab for the information to come through! It's a vital step, but can be overlooked...
Hope this helps :)
Stuart