views:

1028

answers:

1

Hi,

I want to post some message on Facebook wall.

I am able to login and connect with Facebook from iPhone. But i have hard luck to finding out the solution.

Can you please tell me how i can achieve this functionality?

Thanks,
Jim.

+2  A: 

Assuming that you have a valid FBSession Object:

    FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease]; 
    dialog.delegate = self; dialog.userMessagePrompt = @"Example prompt"; 
    dialog.attachment = @"{\"name\":\"Facebook Connect for iPhone\"," "\"href
    \":\"http://developers.facebook.com/connect.php?tab=iphone\"," "\"caption\":\"Caption
    \",\"description\":\"Description\"," "\"media\":[{\"type\":\"image\"," "\"src 
    \":\"http://img40.yfrog.com/img40/5914/iphoneconnectbtn.jpg\"," "\"href
    \":\"http://developers.facebook.com/connect.php?tab=iphone/\"}]," "\"properties     \":{\"another link\":{\"text\":\"Facebook home page\",\"href\":\"http://www.facebook.com\"}}}"; // replace this with a friend's UID // dialog.targetId = @"999999"; 
    [dialog show];

Source: Facebook Connect Reference

Henrik P. Hessel
Thanks Henrik for your help.
Jim
I also figure out the second way. You can use stream.publish method to post message silently on facebook wall.The method mentioned by Henrik also works fine. once again thanks for help.
Jim