开发者

facebook connect php api, how show friends already using an app

what code could i use to display all users who are using 开发者_JS百科my app? i am getting the facebook session as such:

            require_once basepath.'/includes/facebook/src/facebook.php';
            // Create our Application instance.
            $facebook = new Facebook(array(
              'appId' => '#####',
              'secret' => '####',
              'cookie' => true,
            ));

            $session = $facebook->getSession();

how do i show connected users? thanks


You can use a FQL Query like select uid, name, is_app_user from user where uid in (select uid2 from friend where uid1=me()) and is_app_user=1 to get your friends already using an app.


i think this is what you're looking for https://developers.facebook.com/docs/reference/plugins/facepile/


this page may help: http://developers.facebook.com/docs/reference/rest/friends.getAppUsers/


the best way is to use facepile you need to add data-app-id and don't add data-href because if you will add data-href then system will check that url not your app so the facepile div will look like this:

<div class="fb-facepile" data-app-id="YOUR_APP_ID" data-max-rows="1" data-colorscheme="light" data-size="small" data-show-count="true"></div>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜