I'm 'porting' an iPad app to MacOS using Mac Catalyst, and I'm having trouble getting the document share sheet to work properly.
I've tried two ways and they both result in the same thing: no share sheet appears, but only a little popup with a "More..." button (see image).
Attempt #1: using a UIDocumentInteractionController...
NSURL* url = [NSURL fileURLWithPath:fileToShare];
UIDocumentInteractionController* docController = [UIDocumentInteractionController interactionControllerWithURL:url];
[docController presentPreviewAnimated:YES];
[docController presentOptionsMenuFromRect:CGRectMake(x, y, 0, 0) inView:currentView animated:YES];
Attempt #2: using a UIActivityViewController...
NSURL* url = [NSURL fileURLWithPath:fileToShare];
NSArray* shareData = @[url];
UIActivityViewController* activityController = [[UIActivityViewController alloc] initWithActivityItems:shareData applicationActivities:nil];
[self presentViewController:activityController animated:YES completion:NULL];
Since both mechanisms consistently give the same result (both work on iOS and not on MacOS), I have a feeling I need to set some kind of permission or entitlement to get this working on MacOS. But I can't find any hints or documentation to support this.