由於這是沒有nativeScript支持與ios HealthKit ..我正在嘗試使用api。如何使用api從angular2 nativescript獲取isHealthDataAvailable
要開始,我試圖讓一個簡單的布爾爲isHealthDataAvailable():
如何? declare 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.are你在那裏可以找到?您更喜歡使用stackoverflow,但您似乎對評論您的框架感興趣。它變得越來越明顯,使用nativescript還沒有準備好黃金時段。您的文檔已過時 – Tampa