@kingstinct/react-native-healthkit 7.0.0 → 7.0.1
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 +23 -4
- package/package.json +1 -1
package/app.plugin.js
CHANGED
|
@@ -40,16 +40,35 @@ const {
|
|
|
40
40
|
*/
|
|
41
41
|
const withEntitlementsPlugin = (config, { background }) => withEntitlementsPlist(config, (config) => {
|
|
42
42
|
config.modResults['com.apple.developer.healthkit'] = true
|
|
43
|
-
|
|
43
|
+
|
|
44
|
+
// background is enabled by default, but possible to opt-out from
|
|
45
|
+
// (haven't seen any drawbacks from having it enabled)
|
|
46
|
+
if (background !== false) {
|
|
47
|
+
config.modResults['com.apple.developer.healthkit.background-delivery'] = true
|
|
48
|
+
}
|
|
49
|
+
|
|
44
50
|
return config
|
|
45
51
|
})
|
|
46
52
|
|
|
47
53
|
/**
|
|
48
54
|
* @type {ConfigPlugin<InfoPlistConfig>}
|
|
49
55
|
*/
|
|
50
|
-
const withInfoPlistPlugin = (config,
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
const withInfoPlistPlugin = (config,
|
|
57
|
+
/**
|
|
58
|
+
* @type {{NSHealthShareUsageDescription: string | boolean, NSHealthUpdateUsageDescription: string | boolean}}
|
|
59
|
+
* */
|
|
60
|
+
{
|
|
61
|
+
NSHealthShareUsageDescription,
|
|
62
|
+
NSHealthUpdateUsageDescription,
|
|
63
|
+
}) => withInfoPlist(config, (config) => {
|
|
64
|
+
if (NSHealthShareUsageDescription !== false) {
|
|
65
|
+
config.modResults.NSHealthShareUsageDescription = NSHealthShareUsageDescription ?? `${config.name} wants to read your health data`
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (NSHealthUpdateUsageDescription !== false) {
|
|
69
|
+
config.modResults.NSHealthUpdateUsageDescription = NSHealthUpdateUsageDescription ?? `${config.name} wants to update your health data`
|
|
70
|
+
}
|
|
71
|
+
|
|
53
72
|
return config
|
|
54
73
|
})
|
|
55
74
|
|