简体   繁体   中英

Publish to Facebook wall from iPhone application

No Matter what i do, i cannot get a post published to an application page wall (the app being logged into) via an iPhone application. I'm able to log in using FBLoginDialog and then retrieve data to populate a tableview, however when i click a button to publish some test content it doesn't work. Here is the button action:

- (void)compose:(id)sender;
{
 NSString *tid=@"115372005166292";
 NSString *body    = @"My Test";
 NSArray *obj = [NSArray arrayWithObjects:body,[NSString stringWithFormat:@"%@", tid],nil];
 NSArray *keys = [NSArray arrayWithObjects:@"message",@"target_id",nil];
 NSDictionary *params = [NSDictionary dictionaryWithObjects:obj forKeys:keys];
 [[FBRequest requestWithDelegate:self] call:@"facebook.stream.publish" params:params];   
}

I have also used the FBStreamDialog which works, however i'm faced with two issues there. The dialog lacks customization and i'm unable to handle the callback when the item is posted (eg reload the tableview)

I've been searching the internet and all of the examples are similar to the code above, so i'm not sure what i could be missing.

Thanks

You need to ask for extended permissions. After login show this:

FBPermissionDialog* dialog = [[[FBPermissionDialog alloc] init] autorelease];
dialog.delegate = self;
dialog.permission = @"status_update";
[dialog show];

Doc: http://github.com/facebook/facebook-iphone-sdk/#readme

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM