开发者

How retrieve the username to make a complete wall post using a Facebook dialog in an iPhone app?

开发者 https://www.devze.com 2023-01-25 22:32 出处:网络
I\'m using this code to pop up a Facebook dialog and to allow the user to make a wall post, but the user name doesn\'t appear. I\'d like that the post seemed like \"USERNAME is using...\"

I'm using this code to pop up a Facebook dialog and to allow the user to make a wall post, but the user name doesn't appear. I'd like that the post seemed like "USERNAME is using..."

Facebook *facebook = [[Facebook alloc] init];
SBJSON *jsonWriter = [SBJSON new];
NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:                
                    @"is using.... etc etc", @"name",
                    @"A caption", @"caption",
                    @"A description", @"desc开发者_运维问答ription",
                                    nil];

NSString *attachmentStr = [jsonWriter stringWithObject:attachment];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                       API_KEY, @"api_key",
                                       @"Something to say", @"user_message_prompt",
                                       attachmentStr, @"attachment",
                                       nil];

[facebook dialog:@"stream.publish" andParams:params andDelegate:self];

This code works but before "is using...." nothing is printed. The user name doesn't appear. I didn't succeeded in finding a sample, clear docs, to understand this. Any ideas?


You can get the current user data by fetching the json object for "me"; graph.facebook.com/me

0

精彩评论

暂无评论...
验证码 换一张
取 消