[英]Facebook apprequests message in the preview is not displayed on the reciepents notification bar.
我正在使用facebook新请求2.0通过应用程序发送apprequests。 现在,我在发送邀请时会在预览中显示自定义消息,但是,在收件人端,消息未显示,并显示标准消息。 请参阅以下用于此目的的代码。
<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品种。 现在,当用户不是应用用户时,您可以提供给收件人的唯一自定义消息位于您的身份验证对话框或应用程序屏幕中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.