2011-11-15 74 views
2

大约2小时前,我的应用程序中出现以下错误。错误消息:redirect_uri URL格式不正确错误

所有这三个应用程序都使用共享SSL托管在同一台服务器上。

发生错误。请稍后再试。

API错误代码:100 API错误说明:无效的参数错误 消息:REDIRECT_URI网址的格式不正确

上什么会导致我的应用程序这突如其来的变化的任何想法?

当我尝试使用函数sendRequestToManyRecipients()或发布到用户墙时,弹出错误。

代码用来生成弹出

 <script> 
     FB.init({ 
     appId : '<?php echo $fbconfig['appid']?>', 
     status : true, 
     cookie : true, 
     oauth: false 
     }); 

    function sendRequestToManyRecipients() { 
     FB.ui({method: 'apprequests', 
      message: ('I just entered the Payntwagon Audo Targa Terminator Competition! Payntwagon Audio is giving away a brand new Targa Terminator 4 channel amplifier! Enter today to win!'), href: 'http://www.facebook.com/payntwagon?sk=app_279329708764904', 
     }, requestCallback); 
     } 


    function requestCallback(response) 
{ 
    if(response && response.request) { 
       loadPopup(); 
    } else { 

    } 
} 

    </script> 

回答

0
You can do the following : 

1) encode the url before sending, ie both fb url as well as return url 
    u can use javascript functions or php functions for encoding url 

//encodeURIComponent(url); // in javascript u can do this 

2) Also check that the return url specified is valid 
+0

林失去了这里。不确定哪些网址需要编码,以及我在哪里检查以返回网址? –

+0

是的,url被编码为跳过特殊字符,返回url应该是url编码,如果整个url包含任何特殊字符,你也可以编码 –

+0

我认为需要编码的URL是Canvas URL?我找不到任何地方编码它或返回的URL。 有什么建议吗? –