how to check special permissions in facebook

后端 未结 4 1701
野的像风
野的像风 2021-01-11 15:52

how can i check in javascript if user has granted my site the publish stream permission

?

4条回答
  •  独厮守ぢ
    2021-01-11 16:10

    I had this same problem but couldn't find any sample code. Anyways, I came up with this, which works for me. Hope this helps someone.

    FB.api('/me/permissions', function (response) {
                var perms = response.data[0];
    
                if (perms.publish_stream) {                
                    // User has permission
                } else {                
                    // User DOESN'T have permission
                }                                            
        } );
    

提交回复
热议问题