health_kit_api.dart
1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import 'package:pigeon/pigeon.dart';
class HealthUploadResult {
HealthUploadResult({
required this.commonUploadSuccess,
required this.sleepUploadSuccess,
this.errorMessage,
});
bool commonUploadSuccess;
bool sleepUploadSuccess;
String? errorMessage;
}
@ConfigurePigeon(
PigeonOptions(
dartOut: 'lib/pigeon/health_kit_api.g.dart',
dartPackageName: 'doublefeel_flutter',
dartOptions: DartOptions(),
kotlinOut:
'android/app/src/main/kotlin/com/doublefeel/app/pigeon/HealthKitApi.kt',
kotlinOptions: KotlinOptions(
package: 'com.doublefeel.app.pigeon',
),
swiftOut: 'ios/Runner/Pigeon/HealthKitApi.swift',
swiftOptions: SwiftOptions(),
arkTSOut: 'ohos/entry/src/main/ets/pigeon/HealthKitApi.ets',
copyrightHeader: 'pigeon/copyright.txt',
),
)
@HostApi()
abstract class HealthKitHostApi {
bool checkHealthAppAuthorization();
String getHealthServerAuthUrl();
/// Opens Huawei Health client authorization UI. Returns whether user granted.
bool requestHealthClientAuthorization();
bool cancelHealthAppAuthorization();
/// Runs native health read and server upload pipeline.
HealthUploadResult performHealthUpload();
}