turbo
turbo

Reputation: 589

Not able to post to friends wall with facebook sdk in ios

I have tried with openGraph and normal dialog as below,

[facebook requestWithGraphPath:[NSString stringWithFormat:@"/%@/feed",@"friends_fb_id" ] andParams:variables andHttpMethod:@"POST" andDelegate:self];

and

[facebook dialog:@"feed" andParams:params andDelegate:self]

I gave params for both methods as

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"friends_fb_id", @"to", @"I'm using the Hackbook for iOS app", @"name", @"Hackbook for iOS.", @"caption", @"Check out Hackbook for iOS to learn how you can make your iOS apps social using Facebook Platform.", @"description", @"http://m.facebook.com/apps/hackbookios/", @"link", @"http://www.facebookmobileweb.com/hackbook/img/facebook_icon_large.png", @"picture", nil];

in delegate method it correctly return the Post_id, so its completing successfully but I can not see the post on friends wall. If try using the Hackbook app that comes with SDK it works perfectly.

What could be the possible solution.

Upvotes: 0

Views: 812

Answers (2)

Hoo Qing Yu
Hoo Qing Yu

Reputation: 58

Did you forget to enable publish_actions or publish_stream permissions during login?

// login to FB
-(void) FBLogin
{
    NSArray *permissions = [[NSArray alloc] initWithObjects:@"publish_actions",@"publish_stream", nil];
    [FBSession openActiveSessionWithPermissions:permissions allowLoginUI:YES completionHandler:^(FBSession *_session, FBSessionState _status, NSError *_error) {
        //  do some login handling code here
    }];
}

Upvotes: 1

Darren
Darren

Reputation: 10398

You are using the string "friends_fb_id" should this not be an actual id?

I had a similar situation where is was receiving the correct response, so it was posting, it was just posting to the wrong place. Make sure the id's are correct.

Upvotes: 0

Related Questions