从另一个应用程序打开HealthKit App [英] Open HealthKit App from another app

查看:206
本文介绍了从另一个应用程序打开HealthKit App的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想构建一个健身应用程序,将数据上传到HealthKit。有没有办法从另一个应用程序打开/导航到HealthKit?

I want to build a fitness app that will upload the data to HealthKit. Is there any way to open/navigate to HealthKit from another app?

推荐答案

在iOS 10上,Health应用程序URL方案是 x-apple-health 。您可以通过以下方式在自己的应用中打开它:

On iOS 10, the Health app URL scheme is x-apple-health. You can open it from within your own app by calling:

Objective-C:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"x-apple-health://"]];

Swift:

UIApplication.shared.open(URL(string: "x-apple-health://")!)

使用网址方案查看 Open Health应用程序Apple开发者论坛

这篇关于从另一个应用程序打开HealthKit App的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆