2

I want to find the app to which user has shared through the iOS share panel. For this I am implementing the UIDocumentInteractionControllerDelegate method documentInteractionController:willBeginSendingToApplication:

-(IBAction) onOpenWithClicked:(id)sender
    {    
                NSURL* savedURL = [self getURL];

                self.interactionController = [UIDocumentInteractionController interactionControllerWithURL:savedURL];
                self.interactionController.delegate = self;

                [self.interactionController presentOpenInMenuFromRect:self.openWithButton.frame
                                                               inView:self.shareView
                                                             animated:YES];
    }

- (void)documentInteractionController:(UIDocumentInteractionController *)controller willBeginSendingToApplication:(NSString *)application
    {
            NSLog(@"Sharing to application %@", application);
    }

But the issue is that this delegate method is not getting called when user shares to an app's share extension. However, it does gets called when user shares to the main app in the share panel

Please let me know if there is any other way to find which app's share extension is used by the user in the iOS share panel

Rahul
  • 51
  • 4

1 Answers1

0

It is not possible to detect. The same way it is not possible to detect system apps (Notes, share on facebook, airdrop, ...). Basically everything showed as an overlay instead of navigating to a different app won't be notified in that delegate. Look here: willBeginSendingToApplication not called when open EverNote or any other extention

I even tried subclassing UIDocumentInteractionController and reimplementing a bunch of methods like actionSheet:clickedButtonAtIndex. Nothing.

txulu
  • 1,602
  • 16
  • 26