wlepinski / angularjs-facebook-sdk

Integration between AngularJS and Facebook SDK for Javascript.
http://wlepinski.github.io/angularjs-facebook-sdk/
MIT License
36 stars 7 forks source link

IE #3

Closed curt0 closed 9 years ago

curt0 commented 10 years ago

Has anyone been able to log in on IE?

I implemented this code into my AngularJS (version 1.2.6) app and it enables me to login beautifully with Facebook on Chrome, but not IE9 (I have not tested on other versions of IE). Nothing happens when I run facebookService.getLoginStatus(). When I run facebookService.login(), I get Facebook's dialog popup. After I enter my login info and click "Log In", the popup goes blank and nothing happens after that (though, if I open Facebook.com in another tab, it has logged me in there).  Nothing runs after the facebookService.login() line and nothing shows in the console for the Facebook popup.

Has anyone got it to work on IE? Any suggestions on what I need to do?

wlepinski commented 10 years ago

I know that this issue is ancient. But did you found something on this? I'm not able to test right know what is going on.

imrangithub commented 10 years ago

I too face similar issue. When i use FF or chrome immediately after i click login in login popup it makes a GET request and fill my form with the logged in user details.

Whereas when i use IE (9,10,11) nothing happens after i click login. Network tab in f12 also doesn't shows anything .

Am using angular version 1.2.16.

Here is my code of facebookAuthProvider:

sharedModule.provider('$facebookoauthProvider', [ function () { window.fbIntialized = false; var fbOptions = { appId: xxxxxxxxxxxxxxxxx, status: true, xfbml: true, height: 450, width: 450, facebookRedirectUrl: "",
fields: [{ 'name': 'name' }, { 'name': 'birthday' }, { 'name': 'gender' }, { 'name': 'email' }, { 'name': 'password' }, { 'name': 'accept', 'description': 'I accept the disclaimer', 'type': 'checkbox', 'default': 'checked' }], //JSONfields: "[{ 'name': 'name' }, { 'name': 'birthday' }, { 'name': 'gender' }, { 'name': 'email' }, { 'name': 'password' }, { 'name': 'accept', 'description': 'I accept the disclaimer', 'type': 'checkbox', 'default': 'checked' }]", initFB: function ($q, serverURL, applicationVersion) { fbOptions.facebookRedirectUrl = serverURL + "/api/" + applicationVersion + "/FacebookRegistration?languageISOName=" + fbOptions.sessionLanguage.ISOName; var deferred = $q.defer(); setTimeout(function () { try { if (!window.fbIntialized) { FB.init(fbOptions); window.fbIntialized = true; } var elem = document.getElementById('fbError'); if (elem) elem.parentNode.removeChild(elem); deferred.resolve(FB); } catch (e) { deferred.reject(e); } }, 250); return deferred.promise; // Additional initialization code here } }; window.fbAsyncInit = function () { try { if (!window.fbIntialized) { FB.init(fbOptions); window.fbIntialized = true; } var elem = document.getElementById('fbError'); if (elem) elem.parentNode.removeChild(elem); } catch (e) { } }; var onLanguageLoaded = function (lang) { if (lang && lang !== "") { fbOptions.sessionLanguage = lang; if (fbOptions.sessionLanguage) { fbOptions.locale = fbOptions.sessionLanguage.Locale; fbOptions.facebookRedirectUrl = serverURL + "/api/" + applicationVersion + "/FacebookRegistration?languageISOName=" + fbOptions.sessionLanguage.ISOName; fbOptions.fbConnectSrc = "https://connect.facebook.net/" + fbOptions.locale + "/all.js"; (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) { return; } js = d.createElement(s); js.id = id; js.src = fbOptions.fbConnectSrc; //js.src = "https://connect.facebook.net/en_US/all.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); } } else { fbOptions.sessionLanguage = ""; } }; return { $get: ["languageService", "$rootScope", function (languageService, $rootScope) {//options serverURL = $rootScope.serverURL; applicationVersion = $rootScope.applicationVersion; languageService.getCurrentLanguageAsync().then(onLanguageLoaded(languageService.getCurrentLanguage()), onLanguageLoaded); return fbOptions; }] }; }]);

Am i doing anything wrong ?