capacitor-plugin-ihealth 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapacitorPluginIhealth.podspec +1 -1
- package/README.md +6 -6
- package/android/build.gradle +25 -2
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/assets/libiHealth.so +0 -0
- package/android/src/main/assets/libs/arm64-v8a/libBodyfat_SDK.so +0 -0
- package/android/src/main/assets/libs/arm64-v8a/libECGOffline.so +0 -0
- package/android/src/main/assets/libs/arm64-v8a/libECGOnline.so +0 -0
- package/android/src/main/assets/libs/arm64-v8a/libVeryFitMulti.so +0 -0
- package/android/src/main/assets/libs/arm64-v8a/libiHealth.so +0 -0
- package/android/src/main/java/com/managemyhealth/plugins/ihealth/BaseApplication.java +51 -0
- package/android/src/main/java/com/managemyhealth/plugins/ihealth/DeviceCharacteristic.java +49 -0
- package/android/src/main/java/com/managemyhealth/plugins/ihealth/ihealthPlugin.java +1966 -3
- package/android/src/main/libiHealth.so +0 -0
- package/dist/docs.json +3 -3
- package/dist/esm/definitions.d.ts +1 -1
- package/dist/esm/definitions.js.map +1 -1
- package/ios/Plugin/ihealthPlugin.swift +9 -2
- package/package.json +1 -1
@@ -19,7 +19,7 @@ Pod::Spec.new do |s|
|
|
19
19
|
# s.vendored_frameworks = 'iHealthSDK2.7.8.a'
|
20
20
|
s.ios.vendored_library = 'ios/Plugin/libiHealthSDK2.7.8.a'
|
21
21
|
# s.vendored_library = 'ios/Pods/Frameworks/iHealthSDK2.7.8.a'
|
22
|
-
s.preserve_paths = 'ios/Plugin/libiHealthSDK2.7.8.a'
|
22
|
+
s.preserve_paths = 'ios/Plugin/libiHealthSDK2.7.8.a','android/src/iHealthSDK_2.9.10.jar'
|
23
23
|
# s.prepare_command = <<-CMD
|
24
24
|
# if [ -f $PWD/ios/Plugin/libiHealthSDK2.7.8.a ]
|
25
25
|
# then
|
package/README.md
CHANGED
@@ -23,7 +23,7 @@ npx cap sync
|
|
23
23
|
* [`deleteDeviceData()`](#deletedevicedata)
|
24
24
|
* [`getDeviceOfflineData()`](#getdeviceofflinedata)
|
25
25
|
* [`startBP5SMeasurement()`](#startbp5smeasurement)
|
26
|
-
* [`addListener([eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] | [eventName: 'error', listenerFunc: (info: any) => void] | [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] | [eventName: 'StartMeasurementFinished', listenerFunc: (info: any) => void] | [eventName: 'dataNotFound', listenerFunc: (info: any) => void] | [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] | [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] | [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] | [eventName: 'deviceConnect', listenerFunc: (info: any) => void], ...)`](#addlistenereventname-onlinedevicedata-listenerfunc-info-any--void--eventname-error-listenerfunc-info-any--void--eventname-devicedatafound-listenerfunc-info-any--void--eventname-startmeasurementfinished-listenerfunc-info-any--void--eventname-datanotfound-listenerfunc-info-any--void--eventname-deviceconnectfail-listenerfunc-info-any--void--eventname-devicedisconnect-listenerfunc-info-any--void--eventname-devicediscover-listenerfunc-info-any--void--eventname-deviceconnect-listenerfunc-info-any--void)
|
26
|
+
* [`addListener([eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] | [eventName: 'toast', listenerFunc: (info: any) => void] | [eventName: 'error', listenerFunc: (info: any) => void] | [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] | [eventName: 'StartMeasurementFinished', listenerFunc: (info: any) => void] | [eventName: 'dataNotFound', listenerFunc: (info: any) => void] | [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] | [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] | [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] | [eventName: 'deviceConnect', listenerFunc: (info: any) => void], ...)`](#addlistenereventname-onlinedevicedata-listenerfunc-info-any--void--eventname-toast-listenerfunc-info-any--void--eventname-error-listenerfunc-info-any--void--eventname-devicedatafound-listenerfunc-info-any--void--eventname-startmeasurementfinished-listenerfunc-info-any--void--eventname-datanotfound-listenerfunc-info-any--void--eventname-deviceconnectfail-listenerfunc-info-any--void--eventname-devicedisconnect-listenerfunc-info-any--void--eventname-devicediscover-listenerfunc-info-any--void--eventname-deviceconnect-listenerfunc-info-any--void)
|
27
27
|
* [Interfaces](#interfaces)
|
28
28
|
* [Type Aliases](#type-aliases)
|
29
29
|
|
@@ -154,15 +154,15 @@ startBP5SMeasurement() => Promise<{ value: any; }>
|
|
154
154
|
--------------------
|
155
155
|
|
156
156
|
|
157
|
-
### addListener([eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] | [eventName: 'error', listenerFunc: (info: any) => void] | [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] | [eventName: 'StartMeasurementFinished', listenerFunc: (info: any) => void] | [eventName: 'dataNotFound', listenerFunc: (info: any) => void] | [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] | [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] | [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] | [eventName: 'deviceConnect', listenerFunc: (info: any) => void], ...)
|
157
|
+
### addListener([eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] | [eventName: 'toast', listenerFunc: (info: any) => void] | [eventName: 'error', listenerFunc: (info: any) => void] | [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] | [eventName: 'StartMeasurementFinished', listenerFunc: (info: any) => void] | [eventName: 'dataNotFound', listenerFunc: (info: any) => void] | [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] | [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] | [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] | [eventName: 'deviceConnect', listenerFunc: (info: any) => void], ...)
|
158
158
|
|
159
159
|
```typescript
|
160
|
-
addListener(...args: [eventName: "OnlineDeviceData", listenerFunc: (info: any) => void] | [eventName: "error", listenerFunc: (info: any) => void] | [eventName: "deviceDatafound", listenerFunc: (info: any) => void] | [eventName: "StartMeasurementFinished", listenerFunc: (info: any) => void] | [eventName: "dataNotFound", listenerFunc: (info: any) => void] | [eventName: "deviceConnectFail", listenerFunc: (info: any) => void] | [eventName: "deviceDisconnect", listenerFunc: (info: any) => void] | [eventName: "deviceDiscover", listenerFunc: (info: any) => void] | [eventName: "deviceConnect", listenerFunc: (info: any) => void]) => Promise<PluginListenerHandle> & PluginListenerHandle
|
160
|
+
addListener(...args: [eventName: "OnlineDeviceData", listenerFunc: (info: any) => void] | [eventName: "toast", listenerFunc: (info: any) => void] | [eventName: "error", listenerFunc: (info: any) => void] | [eventName: "deviceDatafound", listenerFunc: (info: any) => void] | [eventName: "StartMeasurementFinished", listenerFunc: (info: any) => void] | [eventName: "dataNotFound", listenerFunc: (info: any) => void] | [eventName: "deviceConnectFail", listenerFunc: (info: any) => void] | [eventName: "deviceDisconnect", listenerFunc: (info: any) => void] | [eventName: "deviceDiscover", listenerFunc: (info: any) => void] | [eventName: "deviceConnect", listenerFunc: (info: any) => void]) => Promise<PluginListenerHandle> & PluginListenerHandle
|
161
161
|
```
|
162
162
|
|
163
|
-
| Param | Type
|
164
|
-
| ---------- |
|
165
|
-
| **`args`** | <code>[eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] \| [eventName: 'error', listenerFunc: (info: any) => void] \| [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] \| [eventName: 'StartMeasurementFinished', listenerFunc: (info: any) => void] \| [eventName: 'dataNotFound', listenerFunc: (info: any) => void] \| [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] \| [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] \| [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] \| [eventName: 'deviceConnect', listenerFunc: (info: any) => void]</code> |
|
163
|
+
| Param | Type |
|
164
|
+
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
165
|
+
| **`args`** | <code>[eventName: 'OnlineDeviceData', listenerFunc: (info: any) => void] \| [eventName: 'toast', listenerFunc: (info: any) => void] \| [eventName: 'error', listenerFunc: (info: any) => void] \| [eventName: 'deviceDatafound', listenerFunc: (info: any) => void] \| [eventName: 'StartMeasurementFinished', listenerFunc: (info: any) => void] \| [eventName: 'dataNotFound', listenerFunc: (info: any) => void] \| [eventName: 'deviceConnectFail', listenerFunc: (info: any) => void] \| [eventName: 'deviceDisconnect', listenerFunc: (info: any) => void] \| [eventName: 'deviceDiscover', listenerFunc: (info: any) => void] \| [eventName: 'deviceConnect', listenerFunc: (info: any) => void]</code> |
|
166
166
|
|
167
167
|
**Returns:** <code>Promise<<a href="#pluginlistenerhandle">PluginListenerHandle</a>> & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
|
168
168
|
|
package/android/build.gradle
CHANGED
@@ -11,7 +11,9 @@ buildscript {
|
|
11
11
|
mavenCentral()
|
12
12
|
}
|
13
13
|
dependencies {
|
14
|
-
classpath 'com.android.tools.build:gradle:8.0.
|
14
|
+
classpath 'com.android.tools.build:gradle:8.0.2'
|
15
|
+
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
|
16
|
+
|
15
17
|
}
|
16
18
|
}
|
17
19
|
|
@@ -26,6 +28,10 @@ android {
|
|
26
28
|
versionCode 1
|
27
29
|
versionName "1.0"
|
28
30
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
31
|
+
multiDexEnabled true
|
32
|
+
ndk {
|
33
|
+
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
34
|
+
}
|
29
35
|
}
|
30
36
|
buildTypes {
|
31
37
|
release {
|
@@ -33,6 +39,13 @@ android {
|
|
33
39
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
34
40
|
}
|
35
41
|
}
|
42
|
+
sourceSets {
|
43
|
+
main {
|
44
|
+
assets.srcDirs += [
|
45
|
+
'src',
|
46
|
+
]
|
47
|
+
}
|
48
|
+
}
|
36
49
|
lintOptions {
|
37
50
|
abortOnError false
|
38
51
|
}
|
@@ -49,10 +62,20 @@ repositories {
|
|
49
62
|
|
50
63
|
|
51
64
|
dependencies {
|
52
|
-
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
65
|
+
// implementation fileTree(dir: 'libs', include: ['*.jar'])
|
53
66
|
implementation project(':capacitor-android')
|
54
67
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
55
68
|
testImplementation "junit:junit:$junitVersion"
|
56
69
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
57
70
|
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
71
|
+
implementation files('src/iHealthSDK_2.9.10.jar')
|
72
|
+
//
|
73
|
+
implementation 'com.alibaba:fastjson:1.2.48'
|
74
|
+
implementation 'com.squareup.okhttp3:okhttp:4.11.0'
|
75
|
+
implementation 'com.squareup.okio:okio:3.2.0'
|
76
|
+
implementation 'com.google.code.gson:gson:2.8.9'
|
77
|
+
implementation 'org.greenrobot:greendao:3.2.2'
|
78
|
+
implementation 'no.nordicsemi.android:dfu:1.8.0'
|
79
|
+
implementation 'com.android.support:multidex:1.0.3'
|
80
|
+
|
58
81
|
}
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,51 @@
|
|
1
|
+
package com.managemyhealth.plugins.ihealth;
|
2
|
+
|
3
|
+
import android.app.Application;
|
4
|
+
import android.content.Context;
|
5
|
+
import android.util.Log;
|
6
|
+
|
7
|
+
import com.ihealth.communication.manager.iHealthDevicesManager;
|
8
|
+
|
9
|
+
/**
|
10
|
+
* <li>全局Application</li>
|
11
|
+
* <li>Base Application</li>
|
12
|
+
* <p>
|
13
|
+
* Created by wj on 2018/11/20
|
14
|
+
*/
|
15
|
+
|
16
|
+
public class BaseApplication extends Application {
|
17
|
+
private static BaseApplication mInstance;
|
18
|
+
//全局context
|
19
|
+
/**
|
20
|
+
* global connect
|
21
|
+
*/
|
22
|
+
public static Context applicationContext;
|
23
|
+
|
24
|
+
@Override
|
25
|
+
public void onCreate() {
|
26
|
+
super.onCreate();
|
27
|
+
mInstance = this;
|
28
|
+
applicationContext = this;
|
29
|
+
init();
|
30
|
+
}
|
31
|
+
|
32
|
+
/**
|
33
|
+
* 初始化
|
34
|
+
*/
|
35
|
+
private void init() {
|
36
|
+
/*
|
37
|
+
* Initializes the iHealth devices manager. Can discovery available iHealth devices nearby
|
38
|
+
* and connect these devices through iHealthDevicesManager.
|
39
|
+
*/
|
40
|
+
iHealthDevicesManager.getInstance().init(this, Log.VERBOSE, Log.VERBOSE);
|
41
|
+
}
|
42
|
+
|
43
|
+
/**
|
44
|
+
* 获取BaseApplication的实例
|
45
|
+
*
|
46
|
+
* @return
|
47
|
+
*/
|
48
|
+
public static BaseApplication instance() {
|
49
|
+
return mInstance;
|
50
|
+
}
|
51
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
package com.managemyhealth.plugins.ihealth;
|
2
|
+
|
3
|
+
public class DeviceCharacteristic {
|
4
|
+
String deviceName;
|
5
|
+
long deviceType;
|
6
|
+
String deviceMac;
|
7
|
+
int rssi;
|
8
|
+
boolean isSelected;
|
9
|
+
|
10
|
+
public String getDeviceName() {
|
11
|
+
return deviceName;
|
12
|
+
}
|
13
|
+
|
14
|
+
public void setDeviceName(String deviceName) {
|
15
|
+
this.deviceName = deviceName;
|
16
|
+
}
|
17
|
+
|
18
|
+
public long getDeviceType() {
|
19
|
+
return deviceType;
|
20
|
+
}
|
21
|
+
|
22
|
+
public void setDeviceType(long deviceType) {
|
23
|
+
this.deviceType = deviceType;
|
24
|
+
}
|
25
|
+
|
26
|
+
public boolean isSelected() {
|
27
|
+
return isSelected;
|
28
|
+
}
|
29
|
+
|
30
|
+
public void setSelected(boolean selected) {
|
31
|
+
isSelected = selected;
|
32
|
+
}
|
33
|
+
|
34
|
+
public int getRssi() {
|
35
|
+
return rssi;
|
36
|
+
}
|
37
|
+
|
38
|
+
public void setRssi(int rssi) {
|
39
|
+
this.rssi = rssi;
|
40
|
+
}
|
41
|
+
|
42
|
+
public String getDeviceMac() {
|
43
|
+
return deviceMac;
|
44
|
+
}
|
45
|
+
|
46
|
+
public void setDeviceMac(String deviceMac) {
|
47
|
+
this.deviceMac = deviceMac;
|
48
|
+
}
|
49
|
+
}
|