简体   繁体   English

通过javascript sdk和应用程序ID向Facebook帖子发布评论时遇到麻烦

[英]having big trouble when posting comments to facebook posts by javascript sdk and app id

First of all i want to do that users of my site will post comment to facebook profile/page/group feed posts i show in my site by javascript sdk this is my code - 首先,我想让我网站的用户将评论发布到我通过javascript sdk在我的网站中显示的Facebook个人资料/页面/群组供稿帖子,这是我的代码-

FB.init({
          appId   : 'APPID', 
          status  : true,            
          cookie  : true,
          xfbml   : true
        });

        FB.login(function(response) {
            if (response.status=='connected') {
                if (response.authResponse.accessToken) {
                   var token =response.authResponse.accessToken;                                                     
                        FB.api('/POSTID/comments?access_token='+token+'', 'POST',{ message:'test' }, function(response) {
                          if (!response || response.error) {
} else { alert('success'); } ........rest of codes

so everything works fine.in my facebook application setting's "Website with Facebook Login" section the site url is set as http://localhost/joomla .all i am doing in a joomla site module and i will install it in my all joomla websites.i installed in my one online site and when i try to post comment as a different user i get error as follows - 因此,一切正常。在我的Facebook应用程序设置的“具有Facebook登录名的网站”部分中,网站网址设置为http://localhost/joomla 。我在joomla网站模块中所做的所有操作,并将其安装在我的所有joomla网站中.i安装在我的一个在线站点中,当我尝试以其他用户身份发表评论时,出现以下错误-

"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." “应用程序配置不允许使用URL 。:应用程序的设置不允许使用一个或多个给定URL。它必须与网站URL或Canvas URL匹配,或者该域必须是应用程序域之一的子域”。

that's because my fb application's site url is not matching with my online site url where i installed this module.so it's look like i can only use the module in my one site by adding that site url in fb app's site url box.so how to overcome this problem?? 那是因为我的fb应用程序的站点URL与我安装此模块的在线站点URL不匹配。因此,看来我只能通过在fb应用程序的站点URL框中添加该站点URL来在一个站点中使用该模块。克服这个问题? can i use javascript sdk without app id when my users will post comments to profile or page or group posts?? 当我的用户将评论发布到个人资料或页面或论坛帖子时,我可以使用没有应用ID的javascript sdk吗? note that i am generating access token to achieve that and situation is that this module will be used in some other sites which is not mine too so is the problems.please help me all ways with details please. 请注意,我正在生成访问令牌以实现该目的,并且情况是该模块将在其他网站(不是我的网站)中使用,所以问题也一样。请向我提供所有详细信息。

thanks 谢谢

You can add multiple app domains to your facebook app in the App Domains field. 您可以在“ App Domains字段中将多个应用程序域添加到您的Facebook应用App Domains
That will let you use the app on multiple sites. 这样您就可以在多个站点上使用该应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM