Search code examples
iphoneiossdkfbconnect

Facebook IOS SDK Feed Post Visibility


I have this function

-(void)feed_post:(NSString *)message andDelegate:(id<FBRequestDelegate>)delegate{
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                   message, @"message",
                                   nil];
    [facebook requestWithGraphPath:@"/me/feed" andParams:params
                     andHttpMethod:@"POST" andDelegate:delegate];

}

to post a message to the user's wall. Everything is working but the post is only visible by me. It seems that it is posting as an own private message. How should I configure the params to change the post visibility? Thanks.


Solution

  • This did the trick. Also I had to delete cookies.

    NSDictionary *dictPrivacy = [NSDictionary dictionaryWithObjectsAndKeys:@"EVERYONE",@"value", nil];
    SBJSON *jsonWriter = [[SBJSON new] autorelease];
    NSString *strPrivacy = [jsonWriter stringWithObject:dictPrivacy];
    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                       message, @"message",
                                       strPrivacy,@"privacy",
                                       nil];