Publishing or managing permissions is not permitted to request with read permissions. FACEBOOK SDK

I am currently trying to implement the Facebook login stream and the registration process in our application. But there is a small problem. I have permissions from our Web-Api, and if I try to pass them to the Facebook openActiveSessionWithReadPermissions SDK method, a message appears with the following message:

 > Terminating app due to uncaught exception > 'com.facebook.sdk:InvalidOperationException', reason: 'FBSession: > Publish or manage permissions are not permited to to be requested with > read permissions. 

So it seems that I cannot publish or manage permissions using this method. Now my question is: why can't I pass this parameter to openActiveSession and how do I do this?

+4
source share
1 answer

If you want to open an active session with privileges other than ReadPermissions , you can try

  openActiveSessionWithPublishPermissions:(NSArray *)permissions defaultAudience:(FBSessionDefaultAudience) allowLoginUI:(BOOL)allowLoginUI completionHandler:^(FBSession *session, FBSessionState status, NSError *error)handler 

method. If you want to reauthorize an already opened session with different permissions, you can use

 - (void)reauthorizeWithReadPermissions:(NSArray*)readPermissions completionHandler:(FBSessionReauthorizeResultHandler)handler; 

or

  - (void)reauthorizeWithPublishPermissions:(NSArray*)writePermissions defaultAudience:(FBSessionDefaultAudience)defaultAudience completionHandler:(FBSessionReauthorizeResultHandler)handler; 

Methods Try passing the FBSession.h class.

+5
source

All Articles