:FbConnect : 사용자의 벽과 뉴스 피드에 동시에 게시 하시겠습니까? 내가 사용 FbConnect FB 로그인하려면 다음 코드를 사용하고
- (IBAction)loginButtonClicked:(id)sender {
facebook = [[Facebook alloc] initWithAppId:@"355949667779777" andDelegate:self];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults objectForKey:@"FBAccessTokenKey"]
&& [defaults objectForKey:@"FBExpirationDateKey"]) {
facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
}
if (![facebook isSessionValid]) {
NSArray *permissions = [[NSArray alloc] initWithObjects:
@"user_likes",
@"read_stream",
@"publish_stream",
nil];
[facebook authorize:permissions];
[permissions release];
}
}
그럼 사용자의 벽에 게시하려면 다음 코드를 사용합니다 포스트는 사용자의 벽에 잘 게시
- (IBAction)postToWallPressed:(id)sender {
SBJSON *jsonWriter = [[SBJSON new] autorelease];
// The action links to be shown with the post in the feed
NSArray* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
@"Get Started",@"name",@"http://m.facebook.com/apps/hackbookios/",@"link", nil], nil];
NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];
// Dialog parameters
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"Testing VB", @"name",
@"Integrating Facebook in VB.", @"caption",
@"VB is a voice morphing app for videos.", @"description",
@"http://www.google.com/", @"link",
@"http://www.freeimagehosting.net/newuploads/49ncw.png", @"picture",
actionLinksStr, @"actions",
nil];
[facebook dialog:@"feed" andParams:params andDelegate:self];
}
, 그러나 그것은 뉴스 피드에 게시되지 않습니다.
내가 뭘 잘못하고 있니? 새로 업데이트 된 페이스 북의 API에 대한
당신에게
APP_ID
을 추가하는 것을 잊지 말라? –나는 우리가 할 수 없다고 생각합니다. 그러나 심지어 로컬 이미지의 URL을 얻고 그 대신에 그 URL을 사용하려고 시도합니다. 그것이 작동 할 수 있습니다 .. 확인한 후 그게 알려줘 .. Logged –