Ios facebook登录请求登录审核权限
我正在使用facebook sdk在facebook墙上共享状态 但我在授权时收到了消息 “提交以供登录审核以下某些权限尚未被facebook批准在ios中使用”“提交以供审核或了解更多信息” 这是我的密码Ios facebook登录请求登录审核权限,ios,facebook-sdk-3.1,Ios,Facebook Sdk 3.1,我正在使用facebook sdk在facebook墙上共享状态 但我在授权时收到了消息 “提交以供登录审核以下某些权限尚未被facebook批准在ios中使用”“提交以供审核或了解更多信息” 这是我的密码 - (IBAction)PostStatus:(id)sender { [self postWithText:self.txtField.text ImageName:nil URL:@"http://developers.facebook.com/ios" Caption:
- (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上分享帖子的代码
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明确提到以下内容: “如果你的应用程序要求的不仅仅是公开的个人资料、电子邮件和用户好友,那么在你的应用程序可以被应用程序开发者以外的人使用之前,你需要通过Facebook进行审查。 查看应用程序的时间通常约为7个工作日。如下文所述,某些额外的敏感权限可能需要14个工作日。 “
因此,在你的问题中,最好只共享文本并检查它是否有效。当你在facebook上注册应用程序时。Facebook只提供三个权限,默认情况下,这些权限是已批准的