health_kit_api.dart
1.08 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
import 'package:pigeon/pigeon.dart';
class HealthAuthorization {
/// -1: AppleHealth不可用, 0: 需要请求授权, 1: 已被授权且能获取到部分数据, 2: 已被拒绝或者没有数据
final int status;
final bool hasData;
HealthAuthorization({required this.status, required this.hasData});
}
@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 {
/// Opens Huawei Health client authorization UI. Returns whether user granted.
@async
HealthAuthorization checkHealthAppAuthorization();
@async
bool requestHealthClientAuthorization();
}