[英]facebook login ask for Login Review Permission
我在Facebook墙上使用facebook sdk进行共享状态。
但是在获得许可的时候得到了消息。
“提交登录审核下面的一些权限尚未被批准在ios中使用提交审核或了解更多”
这是我的代码。
- (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时。 Facebook只提供三个许可,这些许可默认是批准的
电子邮件提供对该人员主电子邮件地址的访问权限。 默认情况下批准此权限。
public_profile提供对个人基本信息的访问,包括名字,姓氏,个人资料图片,性别和年龄范围。 默认情况下批准此权限。
user_friends提供对同时使用您的应用的朋友列表的访问权限。 默认情况下批准此权限。
如果您想使用除它们之外的更多功能,那么您需要将您的应用程序提交到Facebook以使用其他功能
如果想要分享照片然后你必须提交你的应用程序获取发布_操作权限facebook检查你如何使用共享或在你的应用程序发布,你还需要上传屏幕截图与提交,表明你正在使用Facebook共享。
但您可以在Facebook上分享或发布仅使用您在developer.facebook.com上创建应用程序的电子邮件,或者您也可以创建用于共享的测试用户。 但如果您希望每个人都可以通过Facebook分享或发布您需要facebok的许可。
它更好地阅读Facebook开发人员文档。 Facebook明确提到以下内容:
“如果您的应用程序要求的不仅仅是public_profile,电子邮件和user_friends,那么在您的应用程序可供应用程序开发人员以外的人使用之前,需要通过Facebook进行审核。审核您的应用程序的时间通常为7个工作日。敏感权限,如下所述,最多可能需要14个工作日。“
所以在你的问题中,最好只共享文本并检查它是否有效。
这是我在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]];
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.