2

我正在使用 facebook ios6。当我发布图像时,它显示如下图。 在此处输入图像描述

我想包括我的“AppName”

我的代码是

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

给我任何建议

4

2 回答 2

1

如果您使用本机共享对话框,则无法更改它。

旧照片发方法:

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");
}];
于 2012-12-19T10:08:02.430 回答
-1

您必须创建一个 Facebook 应用程序 ID(在创建它时您可以添加您的应用程序名称)并将其包含在您的 .plist 文件中 http://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/3.1 /#编码

于 2012-12-20T12:09:44.833 回答