@kingstinct/react-native-healthkit 9.0.2 → 9.0.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.
Files changed (2) hide show
  1. package/package.json +1 -2
  2. package/app.plugin.js +0 -100
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@kingstinct/react-native-healthkit",
3
- "version": "9.0.2",
3
+ "version": "9.0.4",
4
4
  "description": "React Native bindings for HealthKit",
5
- "type": "module",
6
5
  "main": "lib/commonjs/index.js",
7
6
  "module": "lib/module/index.js",
8
7
  "types": "lib/typescript/index.d.ts",
package/app.plugin.js DELETED
@@ -1,100 +0,0 @@
1
- const {
2
- withPlugins,
3
- createRunOncePlugin,
4
- withEntitlementsPlist,
5
- withInfoPlist,
6
- } = require('@expo/config-plugins')
7
-
8
- /**
9
- * @typedef ConfigPlugin
10
- * @type {import('@expo/config-plugins').ConfigPlugin<T>}
11
- * @template T = void
12
- */
13
-
14
- // please note that the BackgroundConfig currently doesn't actually enable background delivery for any types, but you
15
- // can set it to false if you don't want the entitlement
16
-
17
- /**
18
- * @typedef BackgroundConfig
19
- * @type {false | Partial<Record<
20
- * import('./src/native-types').SampleTypeIdentifier,
21
- * import('./src/native-types').UpdateFrequency
22
- * >>}
23
-
24
- /**
25
- * @typedef InfoPlistConfig
26
- * @type {{
27
- * NSHealthShareUsageDescription?: string | false,
28
- * NSHealthUpdateUsageDescription?: string | false
29
- * }}
30
- */
31
-
32
- /**
33
- * @typedef AppPluginConfig
34
- * @type {InfoPlistConfig & { background?: BackgroundConfig }}
35
- */
36
-
37
- /**
38
- * @type {ConfigPlugin<{background: BackgroundConfig}>}
39
- */
40
- const withEntitlementsPlugin = (
41
- config,
42
- /**
43
- * @type {{background: BackgroundConfig} | undefined}
44
- * */
45
- props,
46
- ) =>
47
- withEntitlementsPlist(config, (config) => {
48
- config.modResults['com.apple.developer.healthkit'] = true
49
-
50
- // background is enabled by default, but possible to opt-out from
51
- // (haven't seen any drawbacks from having it enabled)
52
- if (props?.background !== false) {
53
- config.modResults['com.apple.developer.healthkit.background-delivery'] =
54
- true
55
- }
56
-
57
- return config
58
- })
59
-
60
- /**
61
- * @type {ConfigPlugin<InfoPlistConfig>}
62
- */
63
- const withInfoPlistPlugin = (
64
- config,
65
- /**
66
- * @type {{NSHealthShareUsageDescription: string | boolean, NSHealthUpdateUsageDescription: string | boolean} | undefined}
67
- * */
68
- props,
69
- ) =>
70
- withInfoPlist(config, (config) => {
71
- if (props?.NSHealthShareUsageDescription !== false) {
72
- config.modResults.NSHealthShareUsageDescription =
73
- props.NSHealthShareUsageDescription ??
74
- `${config.name} wants to read your health data`
75
- }
76
-
77
- if (props?.NSHealthUpdateUsageDescription !== false) {
78
- config.modResults.NSHealthUpdateUsageDescription =
79
- props.NSHealthUpdateUsageDescription ??
80
- `${config.name} wants to update your health data`
81
- }
82
-
83
- return config
84
- })
85
-
86
- const pkg = require('./package.json')
87
-
88
- /**
89
- * @type {ConfigPlugin<AppPluginConfig>}
90
- */
91
- const healthkitAppPlugin = (config, props) =>
92
- withPlugins(config, [
93
- [withEntitlementsPlugin, props],
94
- [withInfoPlistPlugin, props],
95
- ])
96
-
97
- /**
98
- * @type {ConfigPlugin<AppPluginConfig>}
99
- */
100
- module.exports = createRunOncePlugin(healthkitAppPlugin, pkg.name, pkg.version)