Reputation: 9887
I'm using the Accounts Framework on iOS 6 to get access to Facebook. As long as the user has logged into Facebook in Settings, it works great. However, when they are not logged in to Facebook, my call to -requestAccessToAccountsWithType:options:completion:
sends a generic system error to the completion block:
Error Domain=com.apple.accounts Code=6 "The operation couldn’t be completed. (com.apple.accounts error 6.)"
Seems pretty useless. Is there some other way I'm supposed to know that the user is not logged in?
(Incidentally, this is not an issue when the user is logged in toFacebook but has disabled access to my app in Settings: that returns an unambiguous error code.)
Upvotes: 0
Views: 485
Reputation: 9887
I think +isAvailableForServiceType:
in SLComposeViewController is what I need. I hadn't thought to look there, because I'm not using SLComposeViewController. But I don't see why I can't call this class method and not try to request access if it returns false.
Upvotes: 1
Reputation: 1991
I'm trying to solve the same issue. I've just notice that the error code is 6 when the use has not connect the phone with facebook. It's 7 when the user is connected and press the "don't allow" button. The documentation is available in the ACError.h file.
Upvotes: 0