Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add FBConditionalLog statement to better describe system authorizatio…

…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...
commit 8f18184bf9b1cbb9a78903336cf82256cf0d63d7 1 parent f48bf4d
@chrisp-fb chrisp-fb authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/FBSession.m
View
7 src/FBSession.m
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.