Are you authorizing the user just before showing the feed dialog? I helped out another fella who had the same issue a while back: Facebook iOS SDK - Strange Effects in Writing to Status
If that is the case, both authorization and showing the dialog will trigger a dialog to be displayed. You'll have to be sure to only do one at a time (authenticate > wait for success > show feed dialog).
EDIT: This is pretty much how I'm doing it:
MyClass.h
An instance variable where I save the object to share (if authorization is needed):
MyObject *_objectToShare;
...
@property (nonatomic, retain) MyObject *objectToShare; // @synthesized in MyClass.m
MyClass.m
Method used to share the object (via a NSNotification
):
/**
* Method invoked to share an object on Facebook.
*/
- (void)shareObject:(NSNotification *)note {
// show dialog if authorized, otherwise authenticate first
if ([_facebook isSessionValid]) {
// Use Facebook share dialog
NSMutableDictionary *params = [NSMutableDictionary dictionary]; // define key-value params to send to FB
// show feed dialog
[_facebook dialog:@"feed" andParams:params andDelegate:self];
// Clear object to share (as it's been shared now)
self.objectToShare = nil;
}
else {
// authorize with defined permissions
[_facebook authorize:[NSArray arrayWithObjects:@"publish_stream", @"publish_actions", nil]]; // the permissions you need (@see http://developers.facebook.com/docs/reference/api/permissions/)
// save a reference to the track to share (after auth is done)
self.objectToShare = channel;
}
}
The object is shared when user has been authorized by Facebook:
/**
* From FBSessionDelegate. Invoke method to share object if any is defined.
*/
- (void)fbDidLogin {
// share queued object if it's defined
if (self.objectToShare) {
[self shareObject:nil]; // don't pass any notification
}
}