这是我长期以来面临的一个问题,现在也问过一个关于这个的问题,但没有得到解决,但现在我已经完善了我的案例,最新的案例是:
我正在尝试通过图形 api 从代码中检索用户名、发送电子邮件和发布照片,当它在其他服务器上时代码运行良好,但最近我将应用程序移动到 phpfog,从那时起我就面临这个奇怪的问题。
看来问题仅在于需要访问令牌的信息和功能(全名,电子邮件,发布照片),其他信息(例如个人资料图片等)仍然可以轻松检索。
相同的代码在其他服务器上工作得很好,但是一旦我把它带入 phpfog,它就会停止以这种奇怪的方式工作。
如果是,是否需要刷新 access_token,我该怎么做?
try {
$userId = $_POST["user_id"];
$oauth_token = $_POST["oauth_token"];
$userName = json_decode(file_get_contents('https://graph.facebook.com/' . $userId)) -> name;
$userGender = json_decode(file_get_contents('http://graph.facebook.com/' . $userId)) -> gender;
$userPpicture = json_decode(file_get_contents('http://graph.facebook.com/' . $userId)) -> picture;
} catch(Exception $e) {
echo $e -> getMessage();
echo "<br>";
}
请帮我解决这个问题。谢谢你。