Safari에서 URL을 열면 Facebook의 특정 게시물에 쉽게 연결할 수 있지만 아직 Facebook App에서 해당 게시물을 열 수있는 방법을 찾지 못했습니다. Facebook App은 사용자가 'More Posts'를 클릭하기 전에 가장 최근에 게시 된 3 개의 게시물 만 표시합니다. 따라서 관심있는 게시물을 찾는 데는 다소 어려움이 있습니다. 지금은 내 코드이므로 사용자가 Safari의 정확한 게시물에 연결할 수는 있지만 Facebook 앱이 설치되어있는 것은 아닙니다.iOS : 내 애플리케이션에서 Facebook 앱의 특정 게시물을 여는 방법은 무엇입니까?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
NSString *postID = [[parsedPosts objectAtIndex:[indexPath indexAtPosition:1]] objectForKey:@"post_id"];
NSArray *idParts = [postID componentsSeparatedByString:@"_"];
UIApplication *sharedApp = [UIApplication sharedApplication];
NSURL *faceBookURL = [NSURL URLWithString:[NSString stringWithFormat:@"fb://profile/%@", [idParts objectAtIndex:0]]];
if([sharedApp canOpenURL:faceBookURL]){
[sharedApp openURL:faceBookURL];
} else {
NSURL *safariURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://m.facebook.com/story.php?story_fbid=%@&id=%@", [idParts objectAtIndex:1], [idParts objectAtIndex:0]]];
[sharedApp openURL:safariURL];
}
}
작업을 나던에 대한 URL 만해야한다 : FB : // 포스트/123456789_123456789
. 3 년은 오래 기다릴 시간이었습니다. :-) – Tjalsma