在Facebook墙上发布照片

时间:2015-05-12 05:39:33

标签: ios facebook-graph-api

我想在Facebook墙上张贴照片。我正在使用Object Graph API,但这不能成功。

 if ([PostType isEqual:@"photoalbum"])
        {
        NSString  *imgstring=[NSString stringWithFormat:@"%@%@",imgURL,[jsonResponse valueForKey:@"imageUrl"]];
        NSURL *url   = [NSURL URLWithString:imgstring];
        NSData *data = [NSData dataWithContentsOfURL:url];
        UIImage  *image=[UIImage imageWithData:data];
            NSString*postlink =[NSString stringWithFormat:@"%@",[jsonResponse valueForKey:@"postLink"]];


        [dict setObject:PostTitle forKey:@"message"];
        [dict setObject:image forKey:@"image"];
        [dict setObject:postlink forKey:@"postLink"];


            [FBRequestConnection startWithGraphPath:@"me/photos" parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection ,id result ,NSError *error){
                if(!error){
                    NSLog(@"successfull");
                }
                else{
                    NSLog(@"unsuccess");
                }
            }];





        }

此代码有什么问题。谁能帮帮我吗?感谢

0 个答案:

没有答案