[TIMOB-5091] iOS: Call Facebook.authorize() from alert dialog
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2011-11-18T11:34:37.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Wienke |
Assignee | Reggie Seagraves |
Created | 2011-08-24T06:06:56.000+0000 |
Updated | 2011-11-18T11:34:58.000+0000 |
Description
Since 1.6.x to 1.7.x functionality with regards calling Ti.Facebook.authorize() does not work inside an alert dialog event listener.
Titanium.Facebook.appid = "181219095251677";
Titanium.Facebook.permissions = ['publish_stream', 'read_stream', 'offline_access'];
facebookNotConnected = function() {
if(Ti.Facebook.loggedIn === false) {
var alertDialog = Titanium.UI.createAlertDialog({
title : 'Facebook',
message : 'You need to login with Facebook',
buttonNames : ['Login Facebook', 'No Thanks']
});
alertDialog.addEventListener('click', function(e) {
if(e.index === 0) {
Titanium.Facebook.authorize();
};
});
alertDialog.show();
}
}
However, when the authorize call is placed in a setTimeout with at least 400ms, the authorize call works just fine.
See Q&A: http://developer.appcelerator.com/question/124236/call-facebookauthorize-from-alert-dialog
Dear Appcelerator, Are there plans on fixing this. I think this is a widely used feature. Because the Facebook popup is familiar it is way more trusted then using the Graph API with a own UI. Kind regards, Wienke Giezeman
Launching a dialog from another dialog is not supported and not generally a good idea. Consider hiding the dialog and using an app level event to launch the FB dialog.