function generateAppRequest() {
try{
$app_id = '';
$app_secret = '';
$token_url = "https://graph.facebook.com/oauth/access_token?" .
"client_id=" . $app_id .
"&client_secret=" . $app_secret .
"&grant_type=client_credentials";
$app_access_token = file_get_contents($token_url);
$user_id ='';
$apprequest_url ="https://graph.facebook.com/" .
$user_id .
"/apprequests?message=''" .
"&data=''&" .
$app_access_token . "&method=post";
$result = file_get_contents($apprequest_url);
echo("App Request sent?", $result);
}
catch(Exception $e){
echo 'Message: ' .$e->getMessage();
}
}
The above code for app generated request does not work. The app does not display anything. Event the exception is not displayed. I am running the app on heroku platform
Here some thoughts you should look at :
Good luck with your project