Iphone 我们可以这样说吗;刚才';AppName';通过iOS“;在facebook上发布图片时
我正在facebook ios6上工作。当我发布图像时,它显示如下图所示。 我想包括我的“AppName” 我的代码是Iphone 我们可以这样说吗;刚才';AppName';通过iOS“;在facebook上发布图片时,iphone,objective-c,facebook,ios6,Iphone,Objective C,Facebook,Ios6,我正在facebook ios6上工作。当我发布图像时,它显示如下图所示。 我想包括我的“AppName” 我的代码是 -(void)facebookbtnclicked { ACAccountStore *accountStore = [[ACAccountStore alloc] init]; ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccou
-(void)facebookbtnclicked
{
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
ACAccount *account = [[ACAccount alloc] initWithAccountType:accountType];
NSLog(@"%@, %@", account.username, account.description);
{
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
SLComposeViewControllerCompletionHandler myBlock = ^(SLComposeViewControllerResult result){
if (result == SLComposeViewControllerResultCancelled) {
NSLog(@"Cancelled");
} else
{
NSLog(@"Done");
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Done" message:@"Image Posted Successfully, Please Create an other Tattoo" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
UINavigationController *navController=self.navigationController;
[navController popViewControllerAnimated:YES];
[alert show];
}
[controller dismissViewControllerAnimated:YES completion:Nil];
};
controller.completionHandler =myBlock;
[controller setInitialText:self.textMsg];
[controller addImage:appDelegate.shareImage];//This image i am posting
[self presentViewController:controller animated:YES completion:Nil];
}
}
给我任何建议如果您使用本机共享对话框,您不能更改它 发布照片的旧方法:
NSDictionary *param = [NSDictionary dictionaryWithObjectsAndKeys:[UIImage imageNamed:@"YOURIMAGE.png"], @"picture", nil];
[FBRequestConnection startWithGraphPath:@"me/feed"
parameters:param
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error)
{
if (error)
NSLog(@"failed");
else
NSLog(@"posted");
}];
您必须创建一个Facebook应用程序id(创建时,您可以添加您的appname),并将其包含在.plist文件中我现在要做的事情。我的客户想通过ios@Paramasivan Samuttiramcan更改此AppName,你可以建议我使用本机共享对话框@Paramasivan Samuttiramcan使用另一种方式吗?请尝试我们以前通过FBRquest发布的方法?我们可以用这个代码发送图片吗@Paramasivan SamuttiramI更新了源代码并给出了我的答案。主要的事情是你必须发送“图片”参数给我/饲料。