|
...
|
...
|
@@ -308,10 +308,9 @@ interface HealthKitHostApi { |
|
|
|
fun cancelHealthAppAuthorization(): Boolean
|
|
|
|
/** Runs native health read and server upload pipeline. */
|
|
|
|
fun performHealthUpload(callback: (Result<HealthUploadResult>) -> Unit)
|
|
|
|
/**
|
|
|
|
* 获取当前已上传的健康数据点,主要用于调试
|
|
|
|
* Opens Huawei Health client authorization UI. Returns whether user granted.
|
|
|
|
*/
|
|
|
|
/**测试使用- 导出本地存储的observer日志 */
|
|
|
|
fun exportHealthObserverRecord(callback: (Result<Boolean>) -> Unit)
|
|
|
|
/** Opens Huawei Health client authorization UI. Returns whether user granted. */
|
|
|
|
fun checkHealthAppAuthorization(callback: (Result<HealthAuthorization>) -> Unit)
|
|
|
|
fun requestHealthClientAuthorization(callback: (Result<Boolean>) -> Unit)
|
|
|
|
fun fetchHrvData(startTime: Long, endTime: Long, callback: (Result<List<HealthUploadDataPoint>>) -> Unit)
|
|
...
|
...
|
@@ -391,6 +390,24 @@ interface HealthKitHostApi { |
|
|
|
}
|
|
|
|
}
|
|
|
|
run {
|
|
|
|
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.exportHealthObserverRecord$separatedMessageChannelSuffix", codec)
|
|
|
|
if (api != null) {
|
|
|
|
channel.setMessageHandler { _, reply ->
|
|
|
|
api.exportHealthObserverRecord{ result: Result<Boolean> ->
|
|
|
|
val error = result.exceptionOrNull()
|
|
|
|
if (error != null) {
|
|
|
|
reply.reply(HealthKitApiPigeonUtils.wrapError(error))
|
|
|
|
} else {
|
|
|
|
val data = result.getOrNull()
|
|
|
|
reply.reply(HealthKitApiPigeonUtils.wrapResult(data))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
channel.setMessageHandler(null)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
run {
|
|
|
|
val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.doublefeel_flutter.HealthKitHostApi.checkHealthAppAuthorization$separatedMessageChannelSuffix", codec)
|
|
|
|
if (api != null) {
|
|
|
|
channel.setMessageHandler { _, reply ->
|
...
|
...
|
|