Skip to content

Commit

Permalink
Add FBConditionalLog statement to better describe system authorizatio…
Browse files Browse the repository at this point in the history
…n (ios6) failures that may be caused by misconfiguration.

Summary:
Add FBConditionalLog statement to better describe system authorization (ios6)
failures that may be caused by misconfiguration.

This handles the code = 7 case, where error looks like

{NSLocalizedDescription=The Facebook server could not fulfill this access
request: remote_app_id does not match stored id },  code:7

Test Plan:
Changed bundle identifier in scrumptious to something bogus. Tried to log on
and verified log message in console.
Verified no logging when bundle identifier is correct.

Revert Plan:

Reviewers: jacl

Reviewed By: jacl

Differential Revision: https://phabricator.fb.com/D589249
  • Loading branch information
chrisp-fb committed Oct 2, 2012
1 parent f48bf4d commit 8f18184
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/FBSession.m
Expand Up @@ -1020,6 +1020,13 @@ - (void)authorizeUsingSystemAccountStore:(ACAccountStore*)accountStore
[accountStore requestAccessToAccountsWithType:accountType
options:options
completion:^(BOOL granted, NSError *error) {
FBConditionalLog(granted || error.code != ACErrorPermissionDenied ||
[error.description rangeOfString:
@"remote_app_id does not match stored id"].location == NSNotFound,
@"System authorization failed:'%@'. This may be caused by a mismatch between"
@" the bundle identifier and your app configuration on the server"
@" at developers.facebook.com/apps.",
error.localizedDescription);

// this means the user has not signed-on to Facebook via the OS
BOOL isUntosedDevice = (!granted && error.code == ACErrorAccountNotFound);
Expand Down

0 comments on commit 8f18184

Please sign in to comment.