1
votes

I am trying to make a post on another user's wall using another user using FBConnect. I am using the embedded method of the iOS Facebook API (that is, I am forcing the browser to appear inside my app, so I am not leaving the application at all). This method works for posting into the wall of the same user, but doesn't work on the wall of another user.

    self.facebook = [[[Facebook alloc] initWithAppId:self.appID andDelegate:self] autorelease];
if ([self.facebook isSessionValid]) {
    [self proceedToPost];
}else{
    NSArray *permissions = [NSArray arrayWithObjects:@"publish_stream", @"email", @"read_stream", @"manage_pages", nil];
    [self.facebook authorize:permissions];
}

- (void)proceedToPost

{

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"aName", @"name",
                               self.appID, @"app_id",
                               self.title, @"caption",
                               self.link, @"link",
                               @"animateURL", @"picture",
                               nil];
[params setObject:"my-user-profile-id" forKey:@"to"];
[self.facebook dialog:@"feed" andParams:params andDelegate:self];

}

The problem is that authorization is done as expected, but when trying to actually post, I see an error message in the embedded browser "cannot post to user's wall".

Can anyone help me with this?

1

1 Answers

0
votes

Did you request the publish_stream permission from the extended permissions?

From the documentation about publish_stream permission:

Enables your app to post content, comments, and likes to a user's stream and to the streams of the user's friends. With this permission, you can publish content to a user's feed at any time, without requiring offline_access. However, please note that Facebook recommends a user-initiated sharing model.

http://developers.facebook.com/docs/reference/api/permissions/

You can request permissons like this:

 NSArray *permissions = [[NSArray alloc] initWithObjects:
            @"publish_stream",
            nil];
        [facebook authorize:permissions];
        [permissions release];