Iphone: FBConnect answering machine for users

I want the automatic post on the user’s wall from my iphone applications (without this “publish” “skip” the dialog box). How can i do this?

+4
source share
1 answer

in a class that implements FBSessionDelegate and FBRequestDelegate , you should call the following:

 Facebook *_facebook = [[Facebook alloc] initWithAppId:kAppId]; NSArray *_permissions = [[NSArray arrayWithObjects: @"read_stream", @"offline_access",nil] retain]; [_facebook authorize:_permissions delegate:self]; 

And this is the call for the fb message (should be used in the same class):

 NSString *message = @"This is the message I want to post"; NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: message, @"message", nil]; [_facebook requestWithMethodName:@"stream.publish" andParams:params andHttpMethod:@"POST" andDelegate:self]; 

If you want to post on another user's wall, you must include the "uid" parameter in the params dictionary. Please refer to http://developers.facebook.com/docs/reference/rest/stream.publish/

PS There are all the necessary examples in the iPhone Facebook to connect the SDK code example, so please do not be afraid to investigate a little bit ;)

+1
source

Source: https://habr.com/ru/post/1308461/


All Articles