我是 php 和 Facebook Sdk 的新手,我想获取用户 ID。我使用了这个代码
<?php
session_start();
require_once 'facebook.php';
$app_id = " 192181400960374";
$app_secret = "1491eddfb575c07e586515b4d5397953";
$fb_app_url = "nemanjatools.boxhost.me";
$facebook = new Facebook(array(
'appId' => $fb_app_id,
'secret' => $fb_secret,
'cookie' => true,
));
$facebook_login_url = $facebook->getLoginUrl(array(
'canvas' => 1,
'fbconnect' => 0,
'scope' => 'publish_stream,user_photos',
'redirect_uri' => $fb_app_url
));
echo $facebook_user_id = $facebook->getUser();
?>
当我打开文件时,它只显示0。我看不到错误在哪里,请帮助我。