Write a message on facebook wall using iphone app

I am making an iphone game where I want to upload an account to the person book. I am new to book codes, I have API from github.com. But I do not know how to write or publish directly my message on the wall of the journal face book in an account yet, how to share my account on facebook. I am logged in. Can anyone help me?

+2


a source to share


2 answers


Assuming the user is already signed up and you have a faceb0ok vaild session, you can use something like this to get started:



- (void) post {
    postingDialog = [[[FBStreamDialog alloc] init] autorelease];
    postingDialog.delegate = self;
    postingDialog.userMessagePrompt = @"Prompt the User:";

    NSString *name = @"Name of thing"
    NSString *href = @"http://www.example.com"

    NSString *caption = @"This is a caption"
    NSString *description = @"This is a description";
    NSString *imageSource = @"http://example.com/1.png";
    NSString *imageHref = @"http://example.com/1.png";

    NSString *linkTitle = @"Link title";
    NSString *linkText = @"Text";
    NSString *linkHref = @"http://www.example.com/iphone";
    postingDialog.attachment = [NSString stringWithFormat:
                                @"{ \"name\":\"%@\","
                                "\"href\":\"%@\","
                                "\"caption\":\"%@\",\"description\":\"%@\","
                                "\"media\":[{\"type\":\"image\","
                                "\"src\":\"%@\","
                                "\"href\":\"%@\"}],"
                                "\"properties\":{\"%@\":{\"text\":\"%@\",\"href\":\"%@\"}}}", name, href, caption, description, imageSource, imageHref, linkTitle, linkText, linkHref];
    [postingDialog show];
}

      

+1


a source


Please refer to the facebook api development at http://wiki.developers.facebook.com/index.php/Facebook_iPhone_SDK

Sample app also provided by facebook for iPhone.



Thanks
Jim.

+2


a source







All Articles