Permalink
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...
1 parent f48bf4d commit 8f18184bf9b1cbb9a78903336cf82256cf0d63d7 @chrisp-fb chrisp-fb committed Oct 1, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/FBSession.m
View
@@ -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);

0 comments on commit 8f18184

Please sign in to comment.