how to get the facebook uid off a page, when you visit that page?
if i go to a page of my friend or anybody,开发者_运维知识库 i need to know the uid. i can get mine like this:
$signed_request = $facebook->getSignedRequest();
$user_id = $signed_request['user_id'];
edit: well i have this app and i need to pull the fakebook url into the application so i can grab the id from there. if i try, i get the app id:
$url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
what i need is to grab the fb link address,like @Rufinus said, something like https://graph.facebook.com/cocacola
any ideas? thanks
I'm still not 100% on what you're asking. It seems like you're definitely looking to get information about a page as opposed to a user.
If you have an app, on a page in a tab like on the coke page, then we'll pass you a signed request that contains the id
of the page
. You can then pass that to https://graph.facebook.com/{ID}
and you'll get the same result as passing https://graph.facebook.com/{vanityUrl}
.
What you want to access from the signed_request
is $signed_request['page']['id']
.
In that same page array, you can also pull ['page']['liked']
which will tell you if the viewer has liked the page. And finally you can access ['page']['admin']
which will tell you if the viewer is also an admin of that page.
If that doesn't answer your question, edit it a little more and i'll re-answer.
you just can call https://graph.facebook.com/cocacola no token needed.
精彩评论