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();
}
}
应用程序生成请求的上述代码不起作用。该应用程序不显示任何内容。事件不显示异常。我在 heroku 平台上运行应用程序