MCKapur
MCKapur

Reputation: 9157

Facebook Connect Posting a Status Update

HI I have got Facebook Connect working with a functional login and logout button. So far thats it, when I press a button a I want to post something to the user. Is there something I have to authorize? What is the precise steps for this. Thank you.

Upvotes: 0

Views: 807

Answers (2)

Malek_Jundi
Malek_Jundi

Reputation: 6160

if you want to set his status thought your FB app without showing a dialog you could do it like this

NSString *message = @"some text";
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:message, message,nil];                          
[fb requestWithGraphPath:@"me/feed" andParams:params andHttpMethod:@"POST" andDelegate:self]; //fb here is the FaceBook instance.

and for sure you will do that after the user login and authorized the permissions .

To Authorize the permissions

if (![fb isSessionValid]) {
    NSArray *permissions = [[NSArray alloc] initWithObjects:@"user_likes", @"read_stream", nil];
    [fb authorize:permissions];
    [permissions release];
}

Upvotes: 1

Juicy Scripter
Juicy Scripter

Reputation: 25938

If you want to publish content to User's Feed you not required to authorize user if you use Feed Dialog for any other ways you required to authorize user prior to content publishing.

For web applications/sites (which isn't the case) there is also way to leverage automatic publishing of content user liked using Like Button social plugin by providing correct OpenGraph meta tags.

You really need to read documentation for iOS SDK, especially Dialogs and Authentication and Getting Started Guide.

Upvotes: 1

Related Questions