facebook登录要求登录审查权限

facebook login ask for Login Review Permission

我正在使用 facebook sdk 在 facebook 墙上分享状态。

但是我在授予权限时收到消息。

"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"

这是我的代码。

  - (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];
     }

 }];
}

这是我在 Facebook 上分享 post 的代码。

if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {

     SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];

                [controller setInitialText:@"your message"];
                [controller addImage:imgSelect.image];//set your image here
                NSLog(@"controller");
                [self presentViewController:controller animated:YES completion:Nil];
}
else{
     UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"No Facebook Account" message:@"There are no Facebook accounts configured. You can add or create a Facebook account in Settings." delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Settings", nil];
                [alert show];
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (buttonIndex == 1)
    {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
    }
}

最好阅读 facebook 开发人员文档。 Facebook 清楚地提到以下内容:

" 如果您的应用要求超过 public_profile、电子邮件和 user_friends,它将需要 Facebook 审核,然后您的应用才能被应用以外的人使用开发商。 审核您的应用程序的时间通常约为 7 个工作日。如下所述,一些特别敏感的权限最多可能需要 14 个工作日。 "

所以在你的问题中,最好只分享文本并检查它是否有效。

当您将应用程序注册到 Facebook 时。 Facebook 只提供三个权限,这些权限是默认批准的

  1. email 提供访问此人的主要电子邮件地址的权限。默认批准此权限。

  2. public_profile 提供对个人基本信息的访问,包括名字、姓氏、个人资料照片、性别和年龄范围。默认批准此权限。

  3. user_friends 提供对也使用您的应用程序的朋友列表的访问。默认批准此权限。

如果你想使用除它们之外的更多功能,那么你需要将你的应用程序提交到 facebook 以使用其他功能

喜欢如果想分享照片那么你必须提交你的应用程序以获得 publish_action 权限 facebook 检查你是如何使用共享或 post 在你的应用程序中你还需要上传屏幕提交的照片显示您正在使用 Facebook 分享。

但您可以在 Facebook 上分享或 post 仅使用您在 developer.facebook.com 上创建应用程序时使用的电子邮件 或者您也可以创建测试用户进行共享。 但是,如果您希望每个人都可以通过 Facebook 分享或 post,则需要获得 Facebook 的许可。