如何获取Facebook粉丝页面ID

I develop a facebook app. This app will be add to Page's tabs. I need to detect the page that add my app. I can just get the url bec. page ID was declared there but facebook put the app inside an iframe and I can't use any javascript or php script to get it.

If you can use PHP then, this would work:


<?php
// PATH TO FB-PHP-SDK
require '../../src/facebook.php';

$facebook = new Facebook(array(
  'appId'  => 'APP_ID',
  'secret' => 'APP_SECRET',
  'cookie' => true,
));
$signed_request = $facebook->getSignedRequest();
if( $page = $signed_request['page'] ) {
    echo $page['id'];
}
?>

Did you mean something like that

You can get the page id by doing a request like this: https://graph.facebook.com/DomaineNameOfYourPage