【问题标题】:Is there any way to open host app from share extension? [duplicate]有没有办法从共享扩展打开主机应用程序? [复制]
【发布时间】:2019-12-29 13:51:06
【问题描述】:

重复链接:link

我已经按照上面的链接,但它不起作用。

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

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
   } 
}

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

我搜索了 Apple forum,但没有得到任何解决方案。

注意:我从 AppStore 中找到了一个能够从共享扩展打开应用的应用。

您的帮助将不胜感激。

【问题讨论】:

    标签: ios swift share-extension


    【解决方案1】:

    Apple 公司不允许这样做。 https://forums.developer.apple.com/thread/27295

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-14
      • 1970-01-01
      相关资源
      最近更新 更多