internet explorer - Javascript SDK not working in Facebook Canvas App IE7/8 -
i developing canvas app , got working required in browsers apart ie 7/8 cannot app auto redirect facebook login screen if users not logged facebook.
i suspect ie not getting state of users through getloginstatus method , therefore cannot fire javascript redirect, , because of remove app functionality not working.
i have ran code through online js lint tool , have tidied few things , tried again having no luck
if try outside of facebook e.g https://mydomain.com/directory, js sdk works , redirects facebook login page not same within facebook iframe
i have noticed within facebook iframe system cannot browser mode , uncertain whether have bearing
here complete code
$(document).ready( function() { //facebook js sdk window.fbasyncinit = function () { fb.init({ appid: 'xxxxxxxxxxxxxxxxx', channelurl: '//www.mydomain.co.uk/facebook-notes/channel.html', // channel file cookie: true, xfbml: true, oauth: true, status: true }); fb.getloginstatus(function (response) { if (response.status === 'connected') { //alert('hello'); $('a#remove-app').click(function () { var request = response.authresponse.accesstoken; $("#dialog:ui-dialog").dialog("destroy"); $("#dialog-confirm").dialog({ height: 140, modal: true, position: [236, 101], buttons: { "yes": function () { if (request) { $.ajax({ url: 'https://graph.facebook.com/me/permissions', type: 'get', data: 'method=delete&access_token=' + request, datatype: 'jsonp', success: function (response) { top.location.href = 'http://facebook.com'; } }); } }, cancel: function () { $(this).dialog("close"); } } }); return false; }); } else { //alert('user not logged in'); var oauth_url = 'https://www.facebook.com/dialog/oauth/'; oauth_url += '?client_id=xxxxxxxxxxxxxxx'; oauth_url += '&redirect_uri=' + encodeuricomponent('https://apps.facebook.com/app_name/'); oauth_url += '&scope=email'; window.top.location = oauth_url; } }, true); $('a#invite-a-friend').click(function () { sendrequestviamultifriendselector(); }); // multi friend selector facebook function sendrequestviamultifriendselector() { fb.ui({ method: 'apprequests', message: 'come , join app on facebook' }); } function requestcallback(response) { alert (response); } }; // load sdk asynchronously (function (d) { var js, id = 'facebook-jssdk', ref = d.getelementsbytagname('script')[0]; if (d.getelementbyid(id)) { return; } js = d.createelement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/en_us/all.js"; ref.parentnode.insertbefore(js, ref); }(document)); });
i appreciate
most manifestation of old third-party-cookies problem. search third party cookies / p3p policy find solutions should make work.
Comments
Post a Comment