Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/44.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 我们可以这样说吗;刚才';AppName';通过iOS“;在facebook上发布图片时_Iphone_Objective C_Facebook_Ios6 - Fatal编程技术网

Iphone 我们可以这样说吗;刚才';AppName';通过iOS“;在facebook上发布图片时

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

我正在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];
    }
}

给我任何建议

如果您使用本机共享对话框,您不能更改它

发布照片的旧方法:

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更新了源代码并给出了我的答案。主要的事情是你必须发送“图片”参数给我/饲料。