【发布时间】:2012-02-12 00:46:20
【问题描述】:
我需要将来自 facebook 的 Oauth 数据捕获到我的表中,我已经编写了这段代码
$app_id = "340088232675552";
$canvas_page = "https://apps.facebook.com/appluckyprice/index.php";
$auth_url = "https://www.facebook.com/dialog/oauth?client_id="
. $app_id . "&redirect_uri=" . urlencode($canvas_page) . "&scope=email,user_birthday,user_hometown";
我正在使用
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
$graph_url = 'https://graph.facebook.com/'.$data["user_id"].'';
$user = json_decode(file_get_contents($graph_url));
$user_email = $data['user']->email;
echo $user_email;
但它没有显示任何内容,如何捕获电子邮件?
【问题讨论】:
标签: php facebook json facebook-graph-api oauth