【发布时间】:2017-06-23 09:56:28
【问题描述】:
由于 ios HealthKit 不支持原生脚本。我正在尝试使用 api。
首先,我试图为 isHealthDataAvailable() 获取一个简单的布尔值:
怎么样? 声明 var NSBundle: any;
constructor() {
if (Platform.isIOS){
let healthStore = NSBundle.mainBundle.HKHealthStore();
let is_avail = healthStore.isHealthDataAvailable();
}
}
(in promise): TypeError: NSBundle.mainBundle.HKHealthStore is not a function. (In 'NSBundle.mainBundle.HKHealthStore()', 'NSBundle.mainBundle.HKHealthStore' is undefined)
这是来自 NativeScript 的引用: https://www.nativescript.org/blog/how-to-enable-healthkit-in-your-nativescript-application
var healthStore = HKHealthStore.new();
And this is how to use HealthKit API in NativeScript. Yes, it is THAT simple.
我请求不同...
【问题讨论】:
-
nativescript 的伙计们。你们在吗?您更喜欢 stackoverflow,但您似乎对评论您的框架不感兴趣。越来越明显的是,nativescript 的使用还没有为黄金时段做好准备。您的文档已过期
标签: nativescript angular2-nativescript