Tom83B
Tom83B

Reputation: 2099

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 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...

Upvotes: 0

Views: 302

Answers (3)

dan
dan

Reputation: 11

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

Upvotes: 1

Alex Bailey
Alex Bailey

Reputation: 1679

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

Upvotes: 0

Stephen Walcher
Stephen Walcher

Reputation: 2575

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.

Upvotes: 0

Related Questions