How to check if a user has granted a certain set of permissions to my PHP app?

前端 未结 2 429
小鲜肉
小鲜肉 2021-02-04 16:58

Based on this question, is there a way to check if a user has granted a certain set of permissions to an app using PHP based Facebook SDK? I\'ve browsed the API but couldn\'t fi

2条回答
  •  时光取名叫无心
    2021-02-04 17:37

    This also worked for me, in cases when I didn't have an access token, but had the user's ID:

    $isGranted = $facebook->api(array(
        "method"    => "users.hasAppPermission",
        "ext_perm"   => "publish_stream",
        "uid"       => $facebook_id
    ));
    

提交回复
热议问题