title: iOS Facebook SDK 3.1 openActiveSessionWithReadPermissions: Detect when user is not granting access
body: <p>I need to know when a user has not granted Facebook access to my app during openActiveSessionWithReadPermissions execution. (Not granted meaning the switch is set to 'OFF' under Settings->Facebook->My App.)</p>
  
  <p>Here is the error when not granted:</p>
  
  <blockquote>
    <p>Error Domain=com.facebook.sdk Code=2 "The operation couldn’t be completed. (com.facebook.sdk error 2.)" UserInfo=0x1fd46780 {com.facebook.sdk:ErrorLoginFailedReason=com.facebook.sdk:ErrorLoginFailedReason}</p>
  </blockquote>
  
  <p>For comparison, here is the error for no network:</p>
  
  <blockquote>
    <p>Error Domain=com.facebook.sdk Code=2 "The operation couldn’t be completed. (com.facebook.sdk error 2.)" UserInfo=0x1edf2eb0 {com.facebook.sdk:ErrorLoginFailedReason=com.facebook.sdk:ErrorLoginFailedReason, com.facebook.sdk:ErrorInnerErrorKey=Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline." UserInfo=0x1ed47a20 {NSErrorFailingURLKey=https://api.facebook.com/method/auth.iosauthorizeapp, NSErrorFailingURLStringKey=https://api.facebook.com/method/auth.iosauthorizeapp, NSLocalizedDescription=The Internet connection appears to be offline.}}</p>
  </blockquote>
  
  <p>Is there a fool-proof way to detect when a user is not granted? Do I just look for error code 2 and one key/value pair in the UserInfo dictionary?</p>
  
  <p>I wish Facebook gave us a <code>BOOL granted</code> like in <code>ACAccountStoreRequestAccessCompletionHandler</code>.</p>