Hello I am new to facebook app development and working over my first app.
My app includes the functionality of retrieving user email, ive the required privileges and user has approved those privileges at the time of authentication but when am trying to retrieve user email through graph api am getting nothing in return however other information such as user display picture, name etc has been successfully retrieved.
at Authentication:
$dialog_url = "http://www.facebook.com/dialog/oauth?client_id=" . $app_id . "&redirect_uri=" . $redirect_uri . "&state=" . $_SESSION['state']."&scope=email,user_photos,publish_stream";
Retrieving user email:
$userEmail = json_decode(file_get_contents('http://graph.facebook.com/' . $userId)) -> email;
echo "email: ".$userEmail;
Kindly help me with this.
Thankyou!
The URL must me https:// insead of http://
And also include the access token.