我正在使用Facebook新请求2.0通过应用程序发送请求。现在,我有一条自定义消息,该消息在发送邀请时在预览中显示,但是,在收件人端,该消息未显示,并且显示标准消息。请参阅下面用于此目的的代码。
<script type="text/javascript" src="https://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
FB.init(
{
appId: '<?php echo $this->fbappid; ?>',
status: true,
cookie: true,
oauth: true,
frictionlessRequests: true
});
function sendRequestViaMultiFriendSelector()
{
FB.getLoginStatus(function(response)
{
if (response.status === 'connected')
{
var uid = response.authResponse.userID;
var accessToken = response.authResponse.accessToken;
FB.ui(
{
method: 'apprequests',
message: 'My Custom Message',
filters: ['all'],
data: '<?php echo $this->application . 'buddies/gifts/' . $this->gift_id ; ?>',
title: 'Send Gifts',
display: 'iframe'
},
function(response)
{
//console.log(response);
if (response && response.to)
{
var idds = response.to.join(',');
$('input[name=ids]').val(idds);
$('#invite').submit();
return false;
} else {
$('#invite_fail').submit();
return false;
}
});
$(document).oneTime(500,'check', function()
{
$(".FB_UI_Dialog").css('width','550px');
});
$(".FB_UI_Dialog").css('width','550px');
}
else if (response.status === 'not_authorized')
{
$('#login_fail').submit();
}
else
{
$('#login_fail').submit();
}
});
}
sendRequestViaMultiFriendSelector();
});
</script>
<?php endif; ?>
我需要显示该自定义消息,否则用户很有可能会忽略该消息并将其视为垃圾邮件。
最佳答案
实际上,从历史上看,以前的应用程序曾经可以控制消息,而太多的恶意应用程序却利用了太多优势。然后,Facebook重新设计了应用程序,以使它们对内容及其发送方式的控制较少,这是有充分理由的。这是新的Requests 2.0品种。现在,当用户不是应用程序用户时,您可以提供给收件人的唯一自定义消息是在您的身份验证对话框或应用程序屏幕上。
关于facebook - 预览中的Facebook请求消息未显示在收据通知栏上。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9546570/