Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
758 views
in Technique[技术] by (71.8m points)

ios - Publish or manage permissions are not permited to to be requested with read permissions FACEBOOK SDK

I am currently trying to implement Facebook Login and Registration Flow to our Application. But there is a little Problem. I've got the permissions from our Web-Api and if i try to pass them to the openActiveSessionWithReadPermissions Method of the Facebook SDK an error with the following message occurs :

> 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 cant pass publish or manage permissions with this method. My question now is : Why can i not pass this parameter to the openActiveSession and how should i do this ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

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

method. Or if you want to reauthorize an already open session with other permissions , you can use

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

or

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

Methods. Try going through FBSession.h class.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...