我正在尝试从我的应用程序启动运行状况应用程序。
我通常尝试使用以下代码行来启动应用程序,如

 let mystr = "health://"
    let myurl = NSURL(string: mystr)!
    if (UIApplication.sharedApplication().canOpenURL(myurl))
    {
         UIApplication.sharedApplication().openURL(myurl)
    }
    else
    {
        print("unable to open")
    }

我尝试了上面的代码。我得到了错误(“空”)。
有人在这个问题上请帮忙。
提前谢谢。

最佳答案

您不能直接从应用程序打开HealthApp。因为操作系统只支持使用UIApplicationOpenSettingsURLString打开设置应用程序。如果我们使用URL方案打开HealthApp,那么苹果可能会在审查过程中拒绝该应用。

关于iphone - 如何从另一个iOS应用启动Health iOS应用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40019457/

10-12 01:47
查看更多