Description
If you ask some Facebook permissions to a user and (s)he accepts, you won't be enabled to ask her/him for a new permission until (s)he disconnect from Facebook.
Steps to reproduce
I have attached an 'app.js' file to reproduce the bug:
- check that the permissions asked are: ['email', 'user_birthday'] (see the label at the bottom of the windonw)
- click on the "Facebook.authorize()" button to call: Ti.Facebook.authorize()
- accept the permissions requested
- now, click on "Change permissions"
- check that the permissions asked are: ['email', 'user_birthday', 'user_likes'] (see the label at the bottom of the windonw)
- click on the "Facebook.authorize()" button to call: Ti.Facebook.authorize()
==> the app doesn't ask for the new permission
- click on "Logout Facebook"
- click on the "Facebook.authorize()" button to call: Ti.Facebook.authorize()
==> the app ask for the new permission
This issue is due to your class [FacebookModule.m](
https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/FacebookModule.m) at this line:
-(void)authorize:(id)args
{
ENSURE_UI_THREAD(authorize, args);
VerboseLog(@"[DEBUG] facebook authorize");
if ([self isLoggedIn]) // <============== [HERE] ===============
{
// if already authorized, this should do nothing
return;
}
if (appid==nil)
{
[self throwException:@"missing appid" subreason:nil location:CODELOCATION];
}
// forget in case it fails
[self _unsave];
NSArray *permissions_ = permissions == nil ? [NSArray array] : permissions;
[facebook setForceDialog:forceDialogAuth];
[facebook authorize:permissions_];
}
No comments