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.)
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.