0
http://nocturnsoft.com/devblog/?p=174サイトから次のコードを取得していて、すべて正常に動作しています。しかし、小さなUIの問題に実行されます。ログインウィンドウがポップアップで開かれていません。 js sdkをインクルードするか、別のコードを使用するとしますか? inとiFrameでページを呼び出すので、ポップアップは重要です。Facebook認証ウィンドウがポップアップ
ありがとうございます。
require_once "src/facebook.php";
$app_id = "xxx";
$app_secret = "xxx";
// Init facebook api.
$facebook = new Facebook(array(
'appId' => $app_id,
'secret' => $app_secret,
'cookie' => true
));
// Get the url to redirect for login to facebook
// and request permission to write on the user's wall.
$login_url = $facebook->getLoginUrl(
array('scope' => 'publish_stream')
);
// If not authenticated, redirect to the facebook login dialog.
// The $login_url will take care of redirecting back to us
// after successful login.
if (! $facebook->getUser()) {
echo <<< EOT
<script type="text/javascript">
top.location.href = "$login_url";
</script>;
EOT;
exit;
}
// Do the wall post.
$facebook->api("/me/feed", "post", array(
message => "Testing Wall post",
picture => "http://www.cjp.org/display_image.aspx?ID=348063",
link => "http://www.cjp.org",
name => "Combined Jewish Philanthropies",
caption => "The Jewish Federations of North America"
));
こんにちはマイケル、迅速な応答をありがとうございました。あなたが言及しているメソッドは動作していますが、ユーザがメッセージを入力するのではなく、メッセージをあらかじめ入力しておきたいです。ありがとう、Rex – rex