开发者

Unable to connect to Facebook Graph API

I have the following code. I'm not getting any errors and my name won't display, even though I authorised the application. I should probably say, that my host doesn't support curl, so I used the api that 开发者_JAVA技巧doesn't need curl (https://github.com/mattmecham/php-sdk)

<?php

require 'src/facebook.php';
$facebook = new Facebook(array(
                'appId'  => 'my app id here',
                'secret' => 'the code that should be here...',
                'cookie' => true,
                ));

$me = $facebook->api('/the thing that follows after facebook.com/ to get to my profile');
echo $me['name']
?>

Do you know where the problem might be? Please let me know if you need any additional info...


This API 100% uses cURL, I just used it and got a cURL error.


Everything seems right with your connection/instantiation info. Perhaps your api call is incorrect. You should be able to use $me = $facebook->api('/me'); to get your info. Try that and see if you get a response.


As far as I see browsing the source code, this api requires curl https://github.com/mattmecham/php-sdk/blob/master/src/facebook.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜