问题
I have searched this problem for long now but all answers have not worked so far.
The code that calls for login:
FB.login(function(response) {
if (response.authResponse) {
FB.api('/me', function(response) {
document.getElementById("nimi").value = response.name;
document.getElementById("email").value = response.email;
FB.ui(
{
method: 'stream.publish',
attachment: {
name: 'Jõulupidu Maikrahv restoranis!',
caption: 'Broneeri firma jõulupidu hubases Maikrahv restoranis! Kingime Uusaasta pidulaua 10- le ja romantilise õhtusöögi kahele! ',
media: [
{
"type": "image",
"src": "http://ssl.advert.ee/maikrahv-joulupidu/maikrahv.jpg",
"href": https+"://ssl.advert.ee/maikrahv-joulupidu/"
}]
},
href: https+'://ssl.advert.ee/maikrahv-joulupidu/',
action_links: [
{ text: 'Maikrahv', href: https+"://ssl.advert.ee/maikrahv-joulupidu/" }
]
},
function(response) {
if (response && response.post_id) {
var ajaxresp = jagame_fbajax();
} else {
fb_alert("Teade!", "Postitust ei jagatud ja ei osale loosimises.");
}
}
);
});
} else {
fb_alert("Viga!", "Kuna õiguseid ei jagatud, ei saanud Sind osalemises kahjuks kirja panna")
}
}, {scope: 'email'});
}
Only IE gives this error
An error occurred with Jõulupidu Maikrahvis. Please try again later.
API Error Code: 191 API Error Description: The specified URL is not owned by the application Error Message: Invalid redirect_uri: Antud URL ei ole rakenduse konfiguratsiooni poolt lubatud.
Application settings:
App Domain: advert.ee ssl.advert.ee
Website:
Siute URL: http://ssl.advert.ee/maikrahv-joulupidu/
App on Facebook:
Canvas URL: http://ssl.advert.ee/maikrahv-joulupidu/
Secure Cavas URL: https://ssl.advert.ee/maikrahv-joulupidu/
Canvas Page: http://apps.facebook.com/maikrahv-joulupidu
Page Tab:
Page Tab Name: Jõulupidu Maikrahvis!
Page Tab URL: http://ssl.advert.ee/maikrahv-joulupidu/
Secure Page Tab URL: https://ssl.advert.ee/maikrahv-joulupidu/
Reported bug also: https://developers.facebook.com/bugs/258868920826496
Please help. App must go live tomorrow :(
回答1:
remove the channelUrl parameter from the fb init. IE reads the javascript incorrectly and puts the channel URL in the redirect_uri query var and it breaks the whole process.
回答2:
Jacob rights.
I put this code:
if ( $.browser.msie ) {
FB.init({
appId : 'APP_ID',
status : true,
cookie : true,
oauth : true,
xfbml : true
});
} else {
FB.init({
appId : APP_ID,
channelUrl : '//example.com/channel.php', // Channel File
status : true,
cookie : true,
oauth : true,
xfbml : true
});
}
and solved the problem.
来源:https://stackoverflow.com/questions/8407708/fb-login-causes-error-191-in-any-ie-internet-exploder