Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8512] iOS: you can' ask new Facebook permission without user logout

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 1.8.0.1
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterRomain
AssigneeUnknown
Created2012-04-04T02:08:49.000+0000
Updated2018-02-28T20:03:29.000+0000

Description

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_];
}

Attachments

FileDateSize
app.js2012-04-04T02:08:49.000+00001609

Comments

No comments

JSON Source