【问题标题】:facebook error when trying to "share" tab尝试“共享”选项卡时出现 facebook 错误
【发布时间】:2011-10-11 09:42:13
【问题描述】:

我一直在关注标签教程here,在我上传到我的服务器之前它看起来很棒,但我收到以下错误

    API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.

这是我的代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> 
    <head> 
        <title>flash</title> 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
        <style type="text/css" media="screen"> 
        html, body { height:100%; background-color: #ffffff;}
        body { margin:0; padding:0; overflow:hidden; }
        #flashContent { width:100%; height:100%; }
        </style> 
        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
    </head> 
    <body> 
    <div id="fb-root"></div>
    <script src="https://connect.facebook.net/en_US/all.js"></script>
    <script>
        FB.init({
        appId : '132536290178355',
    });
    </script>
    <script type="text/javascript">
        $(document).ready(function(){
            $('#share_button').click(function(e){
            e.preventDefault();
            FB.ui(
            {
                method: 'feed',
                name: 'HyperArts Blog',
                link: 'http://mytablink/',
                picture: 'http://www.hyperarts.com/_img/TabPress-LOGO-Home.png',
                caption: 'I love HyperArts tutorials',
                description: 'The HyperArts Blog provides tutorials for all things Facebook',
                message: ''
            });
            });
        });
    </script>
    <img src = "<?=base_url()?>/imgs/share_button.png" id = "share_button">

(我从 codeigniter 视图中提取了这个,这就是我使用 base_url 的原因)

我应该在开发者应用中设置一些东西吗?还是在语法中设置一些东西?

【问题讨论】:

    标签: facebook facebook-graph-api


    【解决方案1】:

    我已经多次遇到此问题 - 仅在页面选项卡上,此代码在画布应用程序中运行良好 - 不幸的是,我不知道解决方案,但这是我使用的解决方法。把它放在一个 javascript 函数中:

        <?
        $ch_title=urlencode($SHARE_TITLE);
        $ch_url=urlencode($FACEBOOK_REDIRECT_URI);
        $ch_summary=urlencode($share_text);
        $ch_image=urlencode($FACEBOOK_APPLICATION_BASEURL.'images/hare-image.png');
        ?>
    
        window.open('http://www.facebook.com/sharer.php?s=100&p[title]=<?php echo $ch_title;?>&p[summary]=<?php echo $ch_summary;?>&p[url]=<?php echo $ch_url; ?>&p[images][0]=<?php echo $ch_image;?>', 'sharer', 'toolbar=0,status=0,width=548,height=325');
    

    这适用于一个烦人的异常:它是一个 javascript 弹出窗口。 :/

    但这是我能找到的从页面标签共享 URL 的唯一方法。

    【讨论】:

      猜你喜欢
      • 2012-12-06
      • 1970-01-01
      • 1970-01-01
      • 2014-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多