2011-11-15 72 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。 有什麼建議嗎? –