简体   繁体   中英

Facebook ios-sdk: feed post don't show on News Feed

I try to post a message to feed, but her show only in profile.

How to do make this message show on news feed and profile feed?

This is my sample code:

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

NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys:
                                                       _gameName,@"text",_gameLink,@"href", nil], nil];

NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];


NSDictionary* imageShare = [NSDictionary dictionaryWithObjectsAndKeys:
                            @"image", @"type",
                            _imageURL, @"src",
                            _gameLink, @"href",
                            nil];


NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
                            title_, @"name",
                            //@"teste", @"caption",
                            _msg, @"description",
                            [NSArray arrayWithObjects:imageShare, nil ], @"media",
                            _gameLink, @"href", nil];

NSString *attachmentStr = [jsonWriter stringWithObject:attachment];

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"Share on Facebook",  @"user_message_prompt",
                               actionLinksStr, @"action_links",
                               attachmentStr, @"attachment",
                               nil];


[_facebook dialog:@"feed" andParams:params andDelegate:self];

If I try to post using without params, the message show in both:

[_facebook dialog:@"feed" andDelegate:self];

Try this:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"some text", @"message",
                               nil];


[facebook requestWithGraphPath:@"/me/feed" andParams:params
                 andHttpMethod:@"POST" andDelegate:self];

I hope it is help. For more parameters read post params

Sorry, but this don't show dialog box.

I solved by deleting and recreating the application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM