Search code examples
iosfacebook-sdk-3.1

facebook login ask for Login Review Permission


I am using facebook sdk for share status on facebook wall.

but I got message while grant permission.

"submit for login review some of the permissions below have not been approved for use by facebook in ios Submit for Review or learn more"

here is my code.

  - (IBAction)PostStatus:(id)sender
  {
    [self postWithText:self.txtField.text ImageName:nil URL:@"http://developers.facebook.com/ios" Caption:nil Name:nil andDescription:nil];

  }


-(void) postWithText: (NSString*) message
       ImageName: (NSString*) image
             URL: (NSString*) url
         Caption: (NSString*) caption
            Name: (NSString*) name
  andDescription: (NSString*) description
  {

NSMutableDictionary* params = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
                               url, @"link",
                               name, @"name",
                               caption, @"caption",
                               description, @"description",
                               message, @"message",
                               UIImagePNGRepresentation([UIImage imageNamed: image]), @"picture",
                               nil];

if ([FBSession.activeSession.permissions indexOfObject:@"publish_actions"] == NSNotFound)
{
    // No permissions found in session, ask for it
    [FBSession.activeSession requestNewPublishPermissions: [NSArray arrayWithObject:@"publish_actions"]
                                          defaultAudience: FBSessionDefaultAudienceFriends
                                        completionHandler: ^(FBSession *session, NSError *error)
     {
         if (!error)
         {
             // If permissions granted and not already posting then publish the story

                 [self postToWall: params];

         }
     }];
}
else
{
    // If permissions present and not already posting then publish the story
        [self postToWall: params];
}
}

 -(void) postToWall: (NSMutableDictionary*) params
 {
  // m_postingInProgress = YES; //for not allowing multiple hits

[FBRequestConnection startWithGraphPath:@"me/feed"
                             parameters:params
                             HTTPMethod:@"POST"
                      completionHandler:^(FBRequestConnection *connection,
                                          id result,
                                          NSError *error)
 {
     if (error)
     {
         //showing an alert for failure
         UIAlertView *alertView = [[UIAlertView alloc]
                                   initWithTitle:@"Post Failed"
                                   message:error.localizedDescription
                                   delegate:nil
                                   cancelButtonTitle:@"OK"
                                   otherButtonTitles:nil];
         [alertView show];
     }

 }];
}

Solution

  • Its better to read facebook developer documentation. Facebook clearly mention following :

    " If your app asks for more than than public_profile, email and user_friends it will require review by Facebook before your app can be used by people other than the app's developers. The time to review your app is usually about 7 business days. Some extra-sensitive permissions, as noted below, can take up to 14 business days. "

    so in your question it is better to share only text and check it works or not.