I'm developing an iOS app that uses Facebook sdk 3.5. My app is compatible with iOS 5.0+.
I followed the How-to section of Facebook developer portal, for implement the login flow. In my app there are calls that required a publish permission and, agree with documentation, i get permission when i need, however i get only read permission in appDelegate.m as follow:

As documentation explains, in the ViewDidLoad of First View Controller i check if FBSession token is valid. If not i recall the FallBack previously writed.

The problem of error code 2, presents when for first time i install the appplication in iOS 6.0+ and the facebook profile is setted yet: magically appears error and when i open the Settings-> Facebbok, the App is not granted. After this, i close the app, i set to 'On' the grant and application function. (i never set to off the permission of app in Settings->Facebook)

I read post of users with this problem and there are various type of solution, but anything solves my issue. In my case this is situation: