Reputation: 22565
I created a php module for Drupal that pulls a public album and display pictures inside it. I discovered that the module suddenly stopped working. I googled and looks like even a public album requires an access token now. I see access token field on https://developers.facebook.com/tools/explorer/?method=GET&path=10150146071791729
In this case, how do I fix this problem? It looks like even offline_access is gone now.
Do I must ask users to accept a certain permission? What permission? It's a public pictures.
Upvotes: 0
Views: 1325
Reputation: 22565
Ok, found an answer.
You need to create an app and get an app id and a secret key.
Once you have those two, download Facebook PHP SDK on https://github.com/facebook/facebook-php-sdk.
Sample Code:
require_once "facebook.php";
$facebook = new Facebook(array(
'appId' => 'appid',
'secret' => 'securet',
));
$token = $facebook->getAccessToken();
$json = file_get_contents("https://graph.facebook.com/293849234?access_token=".$token);
Upvotes: 2