iOS FacebookSDK's Scrumptious sample application doesn't work because it always recieves FBErrorCategoryUserCancelled

StackOverflow https://stackoverflow.com/questions/21526176

  •  06-10-2022
  •  | 
  •  

Domanda

The question is straightforward.

I have run the application without modifying anything on an iPhone 5, iPhone 4S and the simulator, all running iOS7.

I have configured my FB account in Settings so that when I try to login it takes that account. The problem is that when the alert view for permissions appears

Permissions alert view , even if I select OK

(for accepting), it enters the loginView:handleError delegate method with the error being FBErrorCategoryUserCancelled.

The question is here too: Similar SO question, but it has no answers.

È stato utile?

Soluzione

My issue turned out to be missing Facebook app settings. (Specifically, the iOS / Bundle ID settings.)

(See answer here)

Hope this helps someone.

Altri suggerimenti

There is an underlying error that simply surfaces as this generic FBErrorCategoryUserCancelled. To me, it looks like poor design in the Facebook SDK to effectively swallow the error in this way.

You can debug this by setting a breakpoint in the delegate where you get the error.

Then go up the stack to the method inside the Facebook SDK that generated the error -- requestAccessToFacebookAccountStore:defaultAudience:isReauthorize:appID:session:handler. (Or just find that method and set the breakpoint there. Alternatively, You could try calling requestAccessToAccountsWithType yourself and see the error there.)

You can then inspect the underlying error in the debugger

(lldb) po error
Error Domain=com.apple.accounts Code=7 "The Facebook server could not fulfill this access request: The app must ask for a basic read permission  like email at install time." UserInfo=0xb6bfd70 {NSLocalizedDescription=The Facebook server could not fulfill this access request: The app must ask for a basic read permission  like email at install time.}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top