您可以使用 javascript sdk 发送应用请求。
<html>
<head>
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
FB.init({
appId :<?php echo $facebook_appid;?>,
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
function newInvite(){
var receiverUserIds = FB.ui({
method : 'apprequests',
message: 'Invite your Friends for Your App',
},
function(receiverUserIds) {
console.log("IDS : " + receiverUserIds.request_ids);
}
);
//http://developers.facebook.com/docs/reference/dialogs/requests/
}
</script>
</head>
<body>
<?php
//---your app code here-----
//to call the function,
echo "<script type='text/javascript'>newInvite();</script>"
?>
</body>
</html>
将文件另存为 .php 并运行。这应该工作!如果是,则接受答案。快乐编码!