Facebook 在与您的应用配置不同的域上共享?

Facebook share on a different domain than your app configuration?

这是分享按钮的代码:

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.

这个错误是有道理的:我试图在另一个域上分享一些东西。但是为什么首先会有这个限制呢?有解决方法吗?

请注意,发送 link 对话框不会出现任何问题:

FB.ui({
    method: 'send',
    link: 'http://cheese.com/',
});

sharesend 有什么不同?

当为单个应用程序使用多个域名时,有什么解决方法?

Method share: 这用于在 Facebook 上公开共享域或子域,或者如您在 post 中指定的那样。它正在影响应用程序的宣传。 (人们分享的效率如何 links/URLs)。通常在分享时反映出来的应用名称会产生巨大的影响。

Method send: 这用于在 Facebook 上发送私人消息。对app的宣传影响不大。

我认为这是因为,

页面上的任何内容可能具有与在 Facebook 应用程序上注册的域不同的链接。而且它只会作为私人消息发送,不会对 Facebook 造成太大影响。但如果它用作共享,那么它应该有类似的域或子域,因为它反过来会影响 Facebook 的声誉。 (请记住垃圾邮件发送者。)

所以我觉得,如果域不同,则创建不同的 Facebook 应用程序。

我最终在新的 window 中使用旧的 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');