0
페이스 북을 내 iOS 앱에 통합하기 위해 FBGraph API를 사용 중입니다. 특정 페이지의 포토 앨범 또는 친구의 포토 앨범에서 사진을 '좋아요/공유'하고 싶습니다. 가능한가? 어느 누구도이 일을 도와 줄 수 있습니까?iOS - FBGraph API를 사용하여 특정 페이지의 모든 사진을 내 앱에서 "좋아요/공유"할 수 있습니까?
페이스 북을 내 iOS 앱에 통합하기 위해 FBGraph API를 사용 중입니다. 특정 페이지의 포토 앨범 또는 친구의 포토 앨범에서 사진을 '좋아요/공유'하고 싶습니다. 가능한가? 어느 누구도이 일을 도와 줄 수 있습니까?iOS - FBGraph API를 사용하여 특정 페이지의 모든 사진을 내 앱에서 "좋아요/공유"할 수 있습니까?
시도해보십시오. 도움이 될 것입니다. 후 조치 방법에서
사진을 공유하려면 다음 코드를 작성하십시오.
NSMutableDictionary *variables = [NSMutableDictionary dictionaryWithCapacity:1];
NSURL *imageURL = [[NSURL alloc] initWithString:@"http://track_images/images/20120209104734baby-puppy.jpg"];
NSData *imageData = [[NSData alloc] initWithContentsOfURL:imageURL];
UIImage *picture = [UIImage imageWithData:imageData];
FbGraphFile *graph_file = [[FbGraphFile alloc] initWithImage:picture];
[variables setObject:graph_file forKey:@"file"];
FbGraphResponse *fb_graph_response = [fbGraph doGraphPost:@"117795728310/photos" withPostVars:variables];
NSString *res = fb_graph_response.htmlResponse;
NSLog(@"res>> %@",res);
NSRange wordRange = NSMakeRange(0,2);
NSArray *firstWords = [[res componentsSeparatedByString:@"\""] subarrayWithRange:wordRange];
if (![[firstWords objectAtIndex:1] isEqualToString:@"error"]){
//alert for image posted sucessfully.
}
else{
//alert for image not posted sucessfully.
}
감사합니다 murali하지만 ** "좋아요"** 기능을 도와 줄 수 있습니까? –
이것을 시도하십시오 : FbGraphResponse * fb_graph_response = [fbGraph doGraphPost : @ "117795728310/likes"withPostVars : variables]; – iSpark