FBSDKSharingDelegate callbacks only work only with FBSDKShareDialogModeShareSheet - is this expected behaviour? [iOS 10 + 11]

404 views Asked by At

I have been using code like this to share videos to Facebook:

FBSDKShareVideo *video = [[FBSDKShareVideo alloc] init];
video.videoURL = assetURL;

FBSDKShareVideoContent *content = [[FBSDKShareVideoContent alloc] init];
content.video = video;

FBSDKShareDialog *dialog = [[FBSDKShareDialog alloc] init];
dialog.fromViewController = vc;
dialog.shareContent = content;
dialog.delegate = self;
dialog.mode = FBSDKShareDialogModeShareSheet;
if (![dialog canShow]) {
   dialog.mode = FBSDKShareDialogModeNative;
   if (![dialog canShow]) { dialog.mode = FBSDKShareDialogModeAutomatic; }
}
[dialog show]

where the delegate conforms to FBSDKSharingDelegate and implements these methods to track the result:

-(void)sharer:(id<FBSDKSharing>)sharerdidCompleteWithResults:(NSDictionary*)results;
-(void)sharer:(id<FBSDKSharing>)sharerdidFailWithError:(NSError*)error;
-(void)sharerDidCancel:(id<FBSDKSharing>)sharer;

I observe these callbacks working on iOS 10 for FBSDKShareDialogModeShareSheet, but in an otherwise identical implementation they are not called when using other dialog modes (for example) FBSDKShareDialogModeNative. In iOS 11, it doesn't appear that the share sheet mode is available anymore (presumably due to the Social Framework changes).

I don't have Facebook login in my app (nor any login), nor do I do anything to request FB permissions other than expect the user to authenticate within the native FB app. Is it expected that these callbacks will not execute in these other dialog modes, or is there something special I should do to get it them to work in this case?

The FB docs state

The delegate is notified with the results of the sharer as long as the application has permissions to receive the information. For example, if the person is not signed into the containing app, the sharer may not be able to distinguish between completion of a share and cancellation.

We are obviously passing the user to the native Facebook app in which they are authenticated - I'm not sure why this would work for one dialog mode and not for another. I'd rather not have to request the user login, as the whole point is to use the native FB app and let FB manage their own business internally.

Any help would be much appreciated. Thank you!

0

There are 0 answers