I want read the friendlist of a facebook user with fb sdk 4, but the result is always empty. I created the application on facebook for the id and key and the friendlist permission should be granted by default.
The login and retrieving profiledata works, but not the friendlist request. Here the code:
FacebookSession::setDefaultApplication($id, $key);
try {
$session = $helper->getSessionFromRedirect();
} catch(Exception $ex) { /* handle error */ }
$request = new FacebookRequest($session, 'GET', '/me/friends');
$response = $request->execute();
$graphObject = $response->getGraphObject();
print_r($graphObject);
Instead of '/me/friends' I also tried '/{fbid}/friends', '/{fbid}/taggable_friends' and some other combinations I found with google, but all with the same result.
What did I wrong? And I also want to read the list if the user is offline once an hour. Is that possible and how?