简体   繁体   English

与应用程序的共享扩展名共享时,不会调用UIDocumentInteractionControllerDelegate方法

[英]UIDocumentInteractionControllerDelegate methods not getting called when shared to an app's share extension

I want to find the app to which user has shared through the iOS share panel. 我想找到用户已通过iOS共享面板共享的应用程序。 For this I am implementing the UIDocumentInteractionControllerDelegate method documentInteractionController:willBeginSendingToApplication: 为此,我正在实现UIDocumentInteractionControllerDelegate方法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 请让我知道是否还有其他方法可以在iOS共享面板中找到用户使用哪个应用的共享扩展名

It is not possible to detect. 无法检测。 The same way it is not possible to detect system apps (Notes, share on facebook, airdrop, ...). 以同样的方式无法检测系统应用程序(注释,在Facebook上共享,空投等)。 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 在这里看: 打开EverNote或任何其他扩展时,不会调用willBeginSendingToApplication

I even tried subclassing UIDocumentInteractionController and reimplementing a bunch of methods like actionSheet:clickedButtonAtIndex . 我什至尝试UIDocumentInteractionController子类,并重新实现一堆诸如actionSheet:clickedButtonAtIndex的方法。 Nothing. 没有。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当打开系统应用程序(如邮件,消息,Twitter或Facebook)时,不会调用UIDocumentInteractionControllerDelegate方法 - UIDocumentInteractionControllerDelegate methods not called when open system apps like Mail, Messages, Twitter or Facebook 应用未显示在 iOS8 中共享扩展的共享选项的共享菜单中 - App is not showing in the share menu of shared options in shared extension in iOS8 我的应用程序内部WhatsApp的共享扩展 - My App Inside WhatsApp's Share Extension 共享扩展名-未调用beginRequestWithExtensionContext - Share extension - beginRequestWithExtensionContext not called UIDocumentInteractionControllerDelegate检查何时加载文档 - UIDocumentInteractionControllerDelegate check when document is loaded 无法使用“今日扩展的共享应用程序组”共享数据 - Unable to share data using Shared App Groups for Today Extension iOS在使用我的应用程序的共享扩展时在Safari中显示UIAlert - iOS Show UIAlert in Safari when using My App's Share Extension 应用程序进入后台时调用方法 - Methods gets called when app goes to the background UIPickerViewDelegate方法未被调用 - UIPickerViewDelegate Methods Not Getting Called 未调用NSManagedObject方法 - NSManagedObject methods are not getting called
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM