Reputation: 3094
I am making an iphone game , In that I want to upload score on face book. I am new to face book codes, I've got it's API from github.com. But I don't know how to write or post directly my message on wall of face book of log in account else how to share my score on facebook. I've done log in portion. Can any one help me????
Upvotes: 2
Views: 5614
Reputation: 16275
Assuming the user has allready logged in and you have a vaild faceb0ok session, you could use something like this to get you started:
- (void) post {
postingDialog = [[[FBStreamDialog alloc] init] autorelease];
postingDialog.delegate = self;
postingDialog.userMessagePrompt = @"Prompt the User:";
NSString *name = @"Name of thing"
NSString *href = @"http://www.example.com"
NSString *caption = @"This is a caption"
NSString *description = @"This is a description";
NSString *imageSource = @"http://example.com/1.png";
NSString *imageHref = @"http://example.com/1.png";
NSString *linkTitle = @"Link title";
NSString *linkText = @"Text";
NSString *linkHref = @"http://www.example.com/iphone";
postingDialog.attachment = [NSString stringWithFormat:
@"{ \"name\":\"%@\","
"\"href\":\"%@\","
"\"caption\":\"%@\",\"description\":\"%@\","
"\"media\":[{\"type\":\"image\","
"\"src\":\"%@\","
"\"href\":\"%@\"}],"
"\"properties\":{\"%@\":{\"text\":\"%@\",\"href\":\"%@\"}}}", name, href, caption, description, imageSource, imageHref, linkTitle, linkText, linkHref];
[postingDialog show];
}
Upvotes: 1
Reputation: 4719
Please refer the facebook api development at http://wiki.developers.facebook.com/index.php/Facebook_iPhone_SDK
Sample application also given by facebook for iPhone.
Thanks,
Jim.
Upvotes: 2