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?
Did you request the publish_stream permission from the extended permissions?
From the documentation about publish_stream permission:
http://developers.facebook.com/docs/reference/api/permissions/
You can request permissons like this: