ckeck if user like Facebook page or not without request Access Token

别来无恙 提交于 2019-12-04 18:53:40

I dont think it's possible if I'm understanding you correctly... ultimately youre always going to need the user to authorize your app and get an auth token in order to know the user's id. FB doesnt let you know user's uid without their permission

yes , i possible i did that by php with following code with out request and permission from user

        require 'src/facebook.php';
// Create our Application instance (replace this with your appId and secret).
        $facebook = new Facebook( array(
            'appId' => '***************',
            'secret' => '**********************',
            'cookie' => true,
                ) );
        $signed_request = $facebook->getSignedRequest();
// Return you the Page like status
        $like_status = $signed_request[ "page" ][ "liked" ];

        if ( $like_status ) {?>
            <div class="facebook-data-content" id="facebook-data-content"> </div>

        <?php } else {
            ?>
            <div class="like-gate" id="like-gate"> </div>
        <?php } ?>

and you can do the same with JavaScript note : all need check that redirect URL correct first before do anything because most problem about this issues

good luck :)

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