dimanche 1 mars 2015

Check for a particular Facebook user permission using PHP

I have the following code to get a users Facebook permissions:



$request = new FacebookRequest( $session, 'GET', '/me/permissions' );
$response = $request->execute();
$graphObject = $response->getGraphObject()->asArray();


I can type:



echo print_r( $graphObject, 1 );


to get a print out of all the permissions BUT I want to check whether or not a particular permission has been granted (in my case 'publish_actions') and act on it. How do I extract this element of the object to perform an 'if' test in PHP?


Aucun commentaire:

Enregistrer un commentaire