How to post custom facebook stories to timeline

H

1.Create a facebook app & setup app id with your project.
2.create your own story from facebook app opengraph section by creating action & object.
3.Post one story to app owner timeline & submit it to the facebook review team so that it will be become public for app user & can be seen publicaly on timeline
follwing code shows the how to post the story.

-(void)Poststory
{
NSString *itemname=@””;
NSString *link=@””;
NSString *url=@””;
NSString *description=@””;

NSMutableDictionary *object =
[FBGraphObject openGraphObjectForPostWithType:@”appnamespace:objectname” title:itemname
image:link
url:url
description:description];

[FBRequestConnection startForPostOpenGraphObject:object
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {

NSString *objectId = [result objectForKey:@”id”];

NSMutableDictionary *action = [FBGraphObject graphObject];
action[@”objectname”] = objectId;
action[@”fb:explicitly_shared”]=@”true”;//allows on timeline
[FBRequestConnection startForPostWithGraphPath:@”me/appnamespace:actionname”
graphObject:action
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error) {
// handle the result

}];
}];
}

Creating the custom story in opengraph
FOR MORE DETAIL REFER THE LINK

About the author

sanjay.raskar
By sanjay.raskar

Category