开发者

facebook error when trying to "share" tab

i was following the tab tutorial here which seemed excellent until i uploaded to my server and i get the following error

    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.

here is my code

<!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;}
        b开发者_开发技巧ody { 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">

(i extracted this from codeigniter view thats why am using base_url)

should i set something in the developer app? or set something in the syntax?


I have run into this problem a number of times - only on page tabs, this code works fine in canvas apps - I dont know the solution unfortunately but this is a workaround I use. Place this in a javascript function:

    <?
    $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');

This works fine with one annoying exception: its a javascript popup window. :/

But its the only way I've been able to find to share a URL from a page tab.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜