Facebook Connect iPhone Custom Publish Stream

I just downloaded the Facebook SDK for iOS because I need to be able to publish custom threads for custom Facebook feeds. The sample application has a method called publishStream: (id) the sender that appears to be setting up a custom description for the Publish Stream dialog box, but when my dialog appears, all I see is an empty dialog to start typing . The code in the sample is as follows:

`SBJSON * jsonWriter = [[SBJSON new] autorelease];

NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys: @"Always Running",@"text",@"http://itsti.me/",@"href", nil], nil]; NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks]; NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys: @"a long run", @"name", @"The Facebook Running app", @"caption", @"it is fun", @"description", @"http://itsti.me/", @"href", nil]; NSString *attachmentStr = [jsonWriter stringWithObject:attachment]; NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"Share on Facebook", @"user_message_prompt", actionLinksStr, @"action_links", attachmentStr, @"attachment", nil]; [_app.facebook dialog:@"feed" andParams:params andDelegate:self];` 

Should this code populate the user stream? If so, why is this not a demo project for me? If not, what steps do I need to take to populate the stream with user data?

Thank you for your help,

+4
source share
2 answers

The sample application is a bit outdated. Read the “Channel Documentation” on Facebook to see the properties you can set, and then just do this:

 NSDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys: @"Share on Facebook", @"user_message_prompt", @"http://www.yoursitehere.com/", @"link", @"http://www.yoursitehere.com/thumbnail.jpg", @"picture", nil]; [self.facebook dialog:@"feed" andParams:params andDelegate:self]; 
+9
source

@Mahmud: Good facebook automatically generates your friends channels to show a section of your home channel; After you post on the wall, your friends home screen will receive your post according to the algorithm used by facebook to fill in one home channel; Your feed may not get the top position in home feeds, but it will definitely be there .... after 4 5 posts;

+1
source

Source: https://habr.com/ru/post/1341387/


All Articles