react-native-spike-sdk 2.1.12 → 2.1.14
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/app.plugin.js +73 -0
- package/package.json +2 -1
- package/react-native-spike-sdk.podspec +1 -1
package/app.plugin.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const {
|
|
2
|
+
withEntitlementsPlist,
|
|
3
|
+
withInfoPlist,
|
|
4
|
+
} = require('@expo/config-plugins');
|
|
5
|
+
|
|
6
|
+
const HEALTH_SHARE = 'Allow $(PRODUCT_NAME) to check health info';
|
|
7
|
+
const HEALTH_UPDATE = 'Allow $(PRODUCT_NAME) to update health info';
|
|
8
|
+
const HEALTH_CLINIC_SHARE =
|
|
9
|
+
'Allow $(PRODUCT_NAME) to check health clinical info';
|
|
10
|
+
|
|
11
|
+
const withSpikeHealthKit = (
|
|
12
|
+
config,
|
|
13
|
+
{
|
|
14
|
+
healthSharePermission,
|
|
15
|
+
healthUpdatePermission,
|
|
16
|
+
isClinicalDataEnabled,
|
|
17
|
+
healthClinicalDescription,
|
|
18
|
+
isBackgroundDeliveriesEnabled,
|
|
19
|
+
} = {}
|
|
20
|
+
) => {
|
|
21
|
+
// Add permissions
|
|
22
|
+
config = withInfoPlist(config, (config) => {
|
|
23
|
+
config.modResults.NSHealthShareUsageDescription =
|
|
24
|
+
healthSharePermission ||
|
|
25
|
+
config.modResults.NSHealthShareUsageDescription ||
|
|
26
|
+
HEALTH_SHARE;
|
|
27
|
+
config.modResults.NSHealthUpdateUsageDescription =
|
|
28
|
+
healthUpdatePermission ||
|
|
29
|
+
config.modResults.NSHealthUpdateUsageDescription ||
|
|
30
|
+
HEALTH_UPDATE;
|
|
31
|
+
isClinicalDataEnabled
|
|
32
|
+
? (config.modResults.NSHealthClinicalHealthRecordsShareUsageDescription =
|
|
33
|
+
healthClinicalDescription ||
|
|
34
|
+
config.modResults
|
|
35
|
+
.NSHealthClinicalHealthRecordsShareUsageDescription ||
|
|
36
|
+
HEALTH_CLINIC_SHARE)
|
|
37
|
+
: null;
|
|
38
|
+
|
|
39
|
+
return config;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Add entitlements. These are automatically synced when using EAS build for production apps.
|
|
43
|
+
config = withEntitlementsPlist(config, (config) => {
|
|
44
|
+
config.modResults['com.apple.developer.healthkit'] = true;
|
|
45
|
+
if (
|
|
46
|
+
!Array.isArray(config.modResults['com.apple.developer.healthkit.access'])
|
|
47
|
+
) {
|
|
48
|
+
config.modResults['com.apple.developer.healthkit.access'] = [];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (isClinicalDataEnabled != false) {
|
|
52
|
+
config.modResults['com.apple.developer.healthkit.access'].push(
|
|
53
|
+
'health-records'
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
// Remove duplicates
|
|
57
|
+
config.modResults['com.apple.developer.healthkit.access'] = [
|
|
58
|
+
...new Set(config.modResults['com.apple.developer.healthkit.access']),
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (isBackgroundDeliveriesEnabled) {
|
|
63
|
+
config.modResults[
|
|
64
|
+
'com.apple.developer.healthkit.background-delivery'
|
|
65
|
+
] = true;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return config;
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return config;
|
|
72
|
+
};
|
|
73
|
+
module.exports = withSpikeHealthKit;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-spike-sdk",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.14",
|
|
4
4
|
"description": "Spike API for health and productivity data from wearables and IoT devices",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"android",
|
|
14
14
|
"ios",
|
|
15
15
|
"cpp",
|
|
16
|
+
"app.plugin.js",
|
|
16
17
|
"*.podspec",
|
|
17
18
|
"!lib/typescript/example",
|
|
18
19
|
"!ios/build",
|
|
@@ -5,7 +5,7 @@ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1
|
|
|
5
5
|
|
|
6
6
|
Pod::Spec.new do |s|
|
|
7
7
|
s.name = "react-native-spike-sdk"
|
|
8
|
-
s.version = "2.1.
|
|
8
|
+
s.version = "2.1.14"
|
|
9
9
|
s.summary = "Spike API for health and productivity data from wearables and IoT devices"
|
|
10
10
|
|
|
11
11
|
s.description = <<-DESC
|