新しい PHP SDK と GRAPH API を使用して古い FBML アプリを iFrameに移行しようとしていますが、訪問者の都市を見つける方法がわかりません。
たとえば、私自身の Facebook プロフィールでは、Current CityとHometownの両方をリストしています。
しかし、次の iFrame アプリを試してみると、場所と出身地は印刷されませんが、雇用主や学歴などの他のデータは印刷されます。
<?php
include_once 'facebook.php';
$facebook = new Facebook(array(
'appId' => "182820975103876",
'secret' => "XXXXXXX",
'cookie' => true,
));
$session = $facebook->getSession();
if (!$session) {
$url = $facebook->getLoginUrl();
print("<script type='text/javascript'>top.location.href = '$url';</script>");
} else {
try {
$me = $facebook->api('/me');
print('<pre>');
print_r($me);
print('</pre>');
} catch (FacebookApiException $e) {
print("Error:" . $e);
}
}
?>
これは私が自分で見たデータの一部です。現在の場所はそこにはありません:
Array
(
[first_name] => Alexander
[education] => Array
(
[0] => Array
(
[school] => Array
(
[id] => 106509962720287
[name] => Riga Nr. 40
)
[type] => High School
)
[1] => Array
(
[school] => Array
(
[id] => 103130426393616
[name] => RWTH Aachen University
)
[year] => Array
(
[id] => 143018465715205
[name] => 2000
)
[type] => College
)
)
[gender] => male
...........
)
よろしくアレックス