繁体   English   中英

facebook api获取用户相册,wordpress页面中的照片

[英]facebook api to get user albums , photos in wordpress page

我正在开发一个Wordpress页面以使用Facebook API获取用户相册以及每个相册的照片

这是我的代码:

    function myFBcall(){
         FB.login(function(response) {
              console.log(response);
              if (response.authResponse) {
                   console.log('Welcome!  Fetching your information.... ');
                   FB.api('/me?fields=id,name,albums,photos', function(myalb) {

                   console.log(myalb);
                   jQuery( "#facebookimages" ).html('<h3>My Albums :</h3>');    

                   jQuery.each( myalb.albums.data, function( i, val ) {
                   /* make the API call */
                   FB.api(
                        "/"+val.id+"/picture",
                        function (mycover) {
                             if (mycover && !mycover.error) {

                         jQuery( "#facebookimages" ).append( "<div class='myalbum'
                         onClick='javascript:getmyphotos(\""+val.id+"\",\""+val.name+"\")' ><img src='"+mycover.data.url+"' width='90%' height='90%'/>"+val.name+"</div>" );    
                             }
                        }
                  );
                  });
             });
          } else {
               console.log('User cancelled login or did not fully authorize.');
          }
    },{ 'scope': 'user_photos,publish_actions','return_scopes': true });
    }

它可以与在我的Facebook应用程序中以开发人员或管理员身份注册的用户正常工作

但不能与我的WordPress用户一起使用

如何使其与我的wordpress网站中的所有用户一起使用?

任何帮助?

While I don't have specific knowledge about wordpress, in general, you would need to ask those permissions. If your app was created after april 30, asking for extended permissions require Facebook approval. Read more here: developers.facebook.com/blog/post/2014/04/30/… – Ibrahim yesterday

谢谢易卜拉欣,您的答复使我感到困惑,我请求(user_photos)许可和facebook批准,现在它可以工作,

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM