Question

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", @"description",
                                    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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top