Facebook SDK 4.x iOS Problem Resolution

I am trying to get Feed to enter the custom timeline. I have a login button to which I pass read permissions, including user_posts . Surprisingly, Facebook does not grant me this permission and ignores it.

The code:

 - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.loginButton.readPermissions = @[@"public_profile", @"email", @"user_friends", @"user_posts"]; self.loginButton.delegate = self; if([FBSDKAccessToken currentAccessToken]) { NSLog(@"Have access token"); NSLog(@"permissions .... %@",[FBSDKAccessToken currentAccessToken].permissions); [self retrieveFeed]; } } #pragma mark - Login Delegate -(void) loginButton:(FBSDKLoginButton *)loginButton didCompleteWithResult:(FBSDKLoginManagerLoginResult *)result error:(NSError *)error { NSLog(@"Login Successfully!!"); NSLog(@"permissions .... %@",[FBSDKAccessToken currentAccessToken].permissions); [self retrieveFeed]; } -(void) loginButtonDidLogOut:(FBSDKLoginButton *)loginButton { } #pragma mark - Receive FB Feed -(void) retrieveFeed { FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:@"/me/feed" parameters:nil]; FBSDKGraphRequestConnection *connection = [[FBSDKGraphRequestConnection alloc] init]; [connection addRequest:request completionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) { NSLog(@"%@",result); if(error) NSLog(@"Some error FEED;;;;;; %@",error.localizedDescription); }]; [connection start]; } 

When I click the login button, I get the following permissions screen. Facebook ignored the permission of user_posts .

enter image description here

Even if I try to get this permission later after logging in, Facebook informs me that I already allowed the application to do this, even if there is no such permission! Code for obtaining a new permit:

 -(void) checkForFeedPermission { if ([[FBSDKAccessToken currentAccessToken] hasGranted:@"user_posts"]) { NSLog(@"already granted feed access"); [self retrieveFeed]; } else { FBSDKLoginManager *loginManager = [[FBSDKLoginManager alloc] init]; [loginManager logInWithReadPermissions:@[@"user_posts"] handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) { NSLog(@"requesting feed access"); [self retrieveFeed]; }]; } } 

I hit my head about this issue for three days. Please suggest me where can I be wrong? Thanks.

+5
source share
2 answers

I think that I am not working on providing user_posts as par documentation for Facebook developers , you must submit your Facebook application for viewing, I attach a screenshot that clearly said.

enter image description here

So you should send your facebook application to view the login , maybe you can set this permission in loginTime

+1
source

If you are in development mode and are not yet ready to publish the application for viewing facebook, the best way to do what you want is to use test users. In your facebook toolbar, go to the Roles section and create some test users. Please note that on the first tab there is a separate tab, not a tester. When you create test users, you can assign by default which permissions should be assigned to this user.

0
source

All Articles