[英]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.