[英]Invite friends popup is struggling, if the user is not logged in
I have created an invite friends code, which is properly working if an FB user is logged in. 我创建了一个邀请朋友代码,如果FB用户已登录,该代码将正常工作。
If I remember correctly, it also worked, when there were no active fb users, in this case it simply shown a fb login page and then it went to an invitation. 如果我没记错的话,当没有活动的fb用户时,它也可以工作,在这种情况下,它只显示了fb登录页面,然后发出了邀请。
Currently the 'invite facebook friends' link is really struggling, if there aren't any active facebook users. 当前,如果没有活动的Facebook用户,“邀请Facebook朋友”链接确实很麻烦。
FB.ui({
appId: '"' + appId + '"',
method: 'apprequests',
display: 'iframe',
message: '"' + message + '"',
title: 'Send your friends an application request'
},
function (response) {
if (response && response.request_ids) {
FB.api(response.request_ids, 'delete');
}
});
Did I do something wrong, or is this a bug in the Facebook invitation? 我做错什么了吗,或者这是Facebook邀请中的错误?
It seems, I got an answer on the Facebook bug site. 看来,我在Facebook错误网站上得到了答案。 However, it should help anybody , who has a lack of FB api knowledge . 但是,它应该可以帮助缺少FB API知识的任何人。 The documentation didn't show this example: If there aren't any active fb session , it just open a login screen. 文档没有显示此示例:如果没有任何活动的fb会话,则只需打开登录屏幕即可。 Finally I just realised what happened: 最后我才意识到发生了什么:
It doesn't show a login screen , if you use an IFRAME . 如果使用IFRAME,则不会显示登录屏幕 。
Do not use that!! 不要使用那个!
Thank you for Noorin Ladhani. 谢谢Noorin Ladhani。
<script>
document.getElementById('send-to-many').onclick = function() {
FB.ui({
method: 'apprequests',
message: 'Visit my page'
}, Log.info.bind('send-to-many callback'));
}
</script>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.