我已經在php mysql中創建了一個facebook應用程序,現在我想將應用程序的更新傳遞給用戶牆,它不是一個像按鈕,而是我想要在用戶牆上共享的一個活動。很像:如何在用戶牆上張貼
XXX剛吃午飯的比薩餅,通過logUrLunch應用
I HV成功地連接到Facebook,並從Facebook獲得的用戶ID如下:
$facebook = new Facebook(array(
'appId' => 'xxxxxxxxxxxxx',
'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
));
// Get User ID
$user = $facebook->getUser();
if ($user) {
try {
// Get the user profile data you have permission to view
$user_profile = $facebook->api('/me');
$uid = $facebook->getUser();
session_start();
$_SESSION['userID'] = $uid;
//print_r($user_profile);
//echo "</pre>";
} catch (FacebookApiException $e) {
$user = null;
}
} else {
die('<script>top.location.href="'.$facebook->getLoginUrl().'";</script>');
}