Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 有没有办法从共享扩展打开主机应用程序?_Ios_Swift_Share Extension - Fatal编程技术网

Ios 有没有办法从共享扩展打开主机应用程序?

Ios 有没有办法从共享扩展打开主机应用程序?,ios,swift,share-extension,Ios,Swift,Share Extension,重复链接: 我遵循了上面的链接,但它不起作用 我的过程:我为主机应用程序创建了一个url方案,并调用OpenURL从共享扩展启动主机应用程序。 (Swift 5,在iOS 13、Xcode 11.3上测试) 我在SLComposeServiceViewController中使用了上述方法,在该控制器中称为openURL(URL(字符串:“MyHostAppScheme:/”)。但无法从此共享扩展应用打开主机应用 我搜索了苹果,但没有找到任何解决方案 注意:我在AppStore中找到了一个可以从共

重复链接:

我遵循了上面的链接,但它不起作用

我的过程:我为主机应用程序创建了一个url方案,并调用OpenURL从共享扩展启动主机应用程序。 (Swift 5,在iOS 13、Xcode 11.3上测试)

我在SLComposeServiceViewController中使用了上述方法,在该控制器中称为openURL(URL(字符串:“MyHostAppScheme:/”)。但无法从此共享扩展应用打开主机应用

我搜索了苹果,但没有找到任何解决方案

注意:我在AppStore中找到了一个可以从共享扩展打开应用的应用


非常感谢您的帮助。

这是苹果公司不允许的。
这是苹果公司不允许的。

func openURL(url: URL) {
   var responder: UIResponder? = self
   while responder != nil {
       if let application = responder as? UIApplication {
            application.perform(#selector(openURL(url:)), with: url)
            return
       }
       responder = responder?.next
   } 
}