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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
//
// HealthUser.h
// iHealthDemoCode
//
// Created by jing on 16/5/13.
// Copyright © 2016年 zhiwei jing. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef enum{
UserAuthen_RegisterSuccess = 1,//New-user registration succeeded
UserAuthen_LoginSuccess,// User login succeeded
UserAuthen_CombinedSuccess,// The user is iHealth user as well, measurement via SDK has been activated, and the data from the measurement belongs to the user
UserAuthen_TrySuccess,//Testing without Internet connection succeeded
UserAuthen_InvalidateUserInfo,//Userid/clientID/clientSecret verification failed
UserAuthen_SDKInvalidateRight,//SDK has not been authorized
UserAuthen_UserInvalidateRight,//User has not been authorized
UserAuthen_InternetError,//Internet error, verification failed
UserAuthen_AppSecretVerifySuccess, // appsecrect is right
UserAuthen_AppSecretVerifyFailed, //appsecrect error
UserAuthen_InputError, //Input error
UserAuthen_CertificateExpired, //Certificate expired
UserAuthen_InvalidCertificate, //Invalid certificate
}UserAuthenResult;
//User
typedef enum{
LengthUnit_Mile = 0,
LengthUnit_Kilometer,
}LengthUnit;
typedef enum{
UserSex_Female = 0,
UserSex_Male,
}UserSex;
typedef enum{
UserType_Guest = 0,
UserType_Normal,
}HS2SUserType;
typedef enum{
HS2SImpedanceMark_NO = 0,
HS2SImpedanceMark_YES,
}HS2SImpedanceMark;
typedef enum{
HS2SFitnessMark_NO = 0,
HS2SFitnessMark_YES,
}HS2SFitnessMark;
typedef enum{
HSUnit_Kg = 1, //kg
HSUnit_LB, //lb
HSUnit_ST //st
}HSUnit;
typedef enum{
UserIsAthelete_No = 0, //No athelete
UserIsAthelete_Yes //athelete
}UserIsAthelete;
typedef enum{
AppSecretVerifySucess = 1,
AppSecretVerifyFailed
}AppSecretVerifyStatus;
typedef enum{
iHealthSDK_BP= 0,
iHealthSDK_BG,
iHealthSDK_HS,
iHealthSDK_PO,
iHealthSDK_AM,
iHealthSDK_ECG,
iHealthSDK_TH,
iHealthSDK_All
}SDKDeviceAccessType;
typedef void(^DisposeSDKUserDeviceAccess)(NSArray*DeviceAccessArray);
typedef void(^DisposeSDKUserValidationSuccess)(UserAuthenResult result);
typedef void(^DisposeSDKUserValidationReturn)(NSString *userID);
typedef void (^DisposeSDKUserValidationErrorBlock)(UserAuthenResult errorID);
@interface HealthUser : NSObject
@property (nonatomic, strong) NSString * clientID;
@property (nonatomic, strong) NSString * clientSecret;
@property (nonatomic, strong) NSString * userID;
@property (nonatomic, strong) NSString * userAccount;
@property (nonatomic, strong) NSString * certificatePath;
@property (nonatomic, strong) NSString * certificateSecret;
@property (nonatomic, strong) NSNumber * serialNub;
@property (nonatomic, strong) NSDate *birthday;
@property (nonatomic, strong) NSNumber *age;
//unit:cm
@property (nonatomic, strong) NSNumber * height;
//kg
@property (strong, nonatomic)NSNumber *weight;
//invalidate
@property (strong, nonatomic)NSNumber *bmr;
//activityLevel=1, Sedentary,spend most of day sitting.
//activityLevel=2, Active,spend a good part of day doing some physical activity.
//activityLevel=3, Very Active,spend most of day doing heavy physical activity.
@property (strong, nonatomic)NSNumber *activityLevel;
@property UserIsAthelete isAthlete;
@property UserSex sex;
@property LengthUnit lengthUnit;
@property HS2SUserType userType;
@property HS2SImpedanceMark impedanceMark;
@property HS2SFitnessMark fitnessMark;
@property NSInteger newDevice;
@property NSInteger createTS;
@property (nonatomic, strong) NSData * hs2SUserID;
@end
|