0

I have been trying to set this up for a few days straight and I just cannot find any decent help anywhere and I am so tired of trying one tutorial after another to do something which shouldn't be too hard to accomplish!

All I have been trying to do is setup the application so I can request permissions to personalize what is shown to the user to add things such as 'Hello NAME' and whatnot to progress to posting to their wall and so on and so fourth...

I know my App ID and App Secret. One tutorial talks about an API Key, of which does not display for me...

I am just so very confused what to do now and I have a ton of test files to delete so if you have anything of use, I would be ever so grateful!

4

1 に答える 1

0

使用する必要がある SDK をダウンロードします。ここでは、PHP SDK を使用していると思います。

CONFIG.PHP

<?php

require_once ("fb/facebook.php");

$config = array();
$config['appId'] = 'xxxxxxxxxxxx';
$config['secret'] = 'xxxxxxxxxxxxxxxxxxxxxxxx';

$facebook = new Facebook($config);
$redirecturi = "http://yoururl/";
$user = $facebook->getUser();
if (empty($user['id']))
{
    $loginUrl = $facebook->getLoginUrl(array('scope' =>
            'YOUR PERMISSIONS HERE SEPERATED BY COMMA', 'redirect_uri' => $redirecturi));

    echo ("<script> top.location.href='" . $loginUrl . "'</script>");
}
$userdata = $facebook->api('/me');

?>

Hello Name をエコーするには、

次に、新しい PHP ファイル index.php を使用します。

<?php
include("config.php");
echo $userdata['name'];
?>

スプーンフィードのビットは知っていますが、そうです、私が始めるのはとても大変だったので、他の人にはそれを簡単に乗り越えてもらいたい.

最初に立ち往生している他の人に役立ちます。

于 2012-11-06T00:18:41.663 に答える