Photos import facebook-php-sdk not working

让人想犯罪 __ 提交于 2019-12-11 15:01:50

问题


$facebook = new Facebook(array(

                'appId'  => '<key>',

                'secret' => '<secret code>',

                'cookie' => true

              ));

print_r($facebook);die;

Output of this is

Facebook Object
(
   [appId:protected] => <key>

   [apiSecret:protected] => <secret code>

   [session:protected] =>

   [signedRequest:protected] =>

   [sessionLoaded:protected] =>

   [cookieSupport:protected] => 1

   [baseDomain:protected] =>

   [fileUploadSupport:protected] =>
)

This problems occur in the end of October only as before that it always prints information of session. Then I call link https://api.facebook.com/method/photos.getAlbums?uid='.$session['uid'].'&access_token='.$session['access_token'] and used to get list of albums.

This works fine for more than 8 months and suddenly from last month it stopped working.


回答1:


We had some troubles on our Facebook API a couple months ago too.

Facebook has deprecated the REST API, which you are using. It is very possible the feature you're trying to access has changed and is no longer supported.

Source: http://developers.facebook.com/blog/post/616/

Switch to the new OAuth2.0 API to restore your features and future proof your application for awhile..

Here's the link to the new API documentation: http://developers.facebook.com/docs/reference/api


Oh, and in the future... Be sure to remove any API keys and secret codes from your posts. These would potentially allow someone else to use your credentials mischievously.



来源:https://stackoverflow.com/questions/13612002/photos-import-facebook-php-sdk-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!