FB 4.0 - FBSession openActiveSessionWithReadPermis

2019-05-02 13:11发布

问题:

I was previously using Facebook SDK 3.x for iOS. My code has FBSession openActiveSessionWithReadPermissions in various places, and now that I am using version 4.x I'm not sure what the replacement is

I am thinking it is the login methods but I'm not sure what the 1:1 replacement/equivalent is.

回答1:

Correct. You can convert over to using the following FBSDKLoginManager method:

- (void)logInWithReadPermissions:(NSArray *)permissions handler:(FBSDKLoginManagerRequestTokenHandler)handler;

Or if looking for publishing permissions you can use:

- (void)logInWithPublishPermissions:(NSArray *)permissions handler:(FBSDKLoginManagerRequestTokenHandler)handler;