Hi All,
I have used Facebook Login in my Titanium App, It was works fine until last week. But for the last two days I am getting error while new user Login with Facebook.
Also I did followed the below thread http://developer.appcelerator.com/question/139217/facebook-login-not-working-today
Modified my Facebook app's advanced settings and set the Authentication to native/desktop
But still I am getting the Error.
Is there any configuration need at http://developers.facebook.com/?
Here Is my sample code
Titanium.Facebook.appid = "xxxxxxxxxxx"; //Production Titanium.Facebook.permissions = ['publish_stream', 'read_stream', 'email', 'user_about_me']; var fbSignupBtn = Ti.UI.createButton({ title: "Login with Facebook", width: 160, left: 10, top: 25 }); win.add(fbSignupBtn); fbSignupBtn.addEventListener('click', function () { Titanium.Facebook.authorize(); }); Titanium.Facebook.addEventListener('login', function (e) { if (e.success) { //some actions here } else if (e.error) { alert("Error = " + e.error); } else if (e.cancelled) { alert("canceld"); } });
I am using Titanium 2.1.1. Thanks in Advance
1 Answer
am using this code in 2 programs and they are working fine
Titanium.Facebook.appid = "xxxxxxxxxxxxxxxx"; Titanium.Facebook.permissions = ['publish_stream']; var share = Ti.UI.createButton({ backgroundImage : 'fb_share.png', height : '42', width : '122', top : 10, left : 10, link : images[n].link, }); share.addEventListener('click', function(e) { if (!Ti.Facebook.loggedIn) { var sourceLink = e.source.link; Ti.Facebook.addEventListener('login', function(e) { if (e.success) { fbSharing(sourceLink); } else if (e.error) { alert(e.error); } else if (e.cancelled) { alert("Canceled"); } }); Ti.Facebook.authorize(); } else { fbSharing(e.source.link); } });and here is the source of
fbSharing function
var fbSharing = function(link) { var resultNotification = Ti.UI.createNotification({ message : 'sharing_done', duration : Ti.UI.NOTIFICATION_DURATION_LONG }); Ti.Facebook.request('links.post', { url : link }, function(e) { if (e.success) { resultNotification.message = 'sharing_done'; resultNotification.show(); } else { resultNotification.message = 'sharing_error'; resultNotification.show(); } }); }
Your Answer
Think you can help? Login to answer this question!