这是分享按钮的代码:
FB.ui({
method: 'share',
href: 'http://cheese.com/',
});
我有多个域重复使用一个应用程序 ID。我们为登录等做了一些解决方法。但至少我希望共享按钮能够正常工作。但这给了我一个经典:
Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
该错误是有道理的:我尝试在另一个域上共享某些内容。但为什么首先会有这个限制呢?有解决办法吗?
请注意,发送链接对话框不会出现任何问题:
FB.ui({
method: 'send',
link: 'http://cheese.com/',
});
分享
和发送
有什么不同?
在单个应用程序中使用多个域名时,解决方法是什么?
最佳答案
我最终在新窗口中使用旧的 sharer.php
方式。
window.open( 'https://www.facebook.com/sharer/sharer.php?u=http://poules.com',
'fbShareWindow',
'toolbar=no,
location=no,
status=no,
menubar=no,
scrollbars=yes,
resizable=yes,
width=600,
height=400');
关于Facebook 在与您的应用程序配置不同的域上共享?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28768428/