@capgo/capacitor-pedometer 8.0.2 → 8.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.
@@ -24,7 +24,7 @@ import com.getcapacitor.annotation.PermissionCallback;
24
24
  )
25
25
  public class CapacitorPedometerPlugin extends Plugin implements SensorEventListener {
26
26
 
27
- private final String pluginVersion = "8.0.2";
27
+ private final String pluginVersion = "8.0.4";
28
28
  private static final String PERMISSION_GRANTED = "granted";
29
29
  private static final String PERMISSION_DENIED = "denied";
30
30
  private static final String PERMISSION_PROMPT = "prompt";
@@ -4,7 +4,7 @@ import Foundation
4
4
 
5
5
  @objc(CapacitorPedometerPlugin)
6
6
  public class CapacitorPedometerPlugin: CAPPlugin, CAPBridgedPlugin {
7
- private let pluginVersion: String = "8.0.2"
7
+ private let pluginVersion: String = "8.0.4"
8
8
  public let identifier = "CapacitorPedometerPlugin"
9
9
  public let jsName = "CapacitorPedometer"
10
10
  public let pluginMethods: [CAPPluginMethod] = [
@@ -128,20 +128,16 @@ public class CapacitorPedometerPlugin: CAPPlugin, CAPBridgedPlugin {
128
128
  return "denied"
129
129
  }
130
130
 
131
- if #available(iOS 11.0, *) {
132
- switch CMMotionActivityManager.authorizationStatus() {
133
- case .authorized:
134
- return "granted"
135
- case .denied, .restricted:
136
- return "denied"
137
- case .notDetermined:
138
- return "prompt"
139
- @unknown default:
140
- return "prompt"
141
- }
131
+ switch CMMotionActivityManager.authorizationStatus() {
132
+ case .authorized:
133
+ return "granted"
134
+ case .denied, .restricted:
135
+ return "denied"
136
+ case .notDetermined:
137
+ return "prompt"
138
+ @unknown default:
139
+ return "prompt"
142
140
  }
143
-
144
- return "granted"
145
141
  }
146
142
 
147
143
  private func createMeasurementDict(from data: CMPedometerData, startDate: Date, endDate: Date) -> [String: Any] {
@@ -161,20 +157,16 @@ public class CapacitorPedometerPlugin: CAPPlugin, CAPBridgedPlugin {
161
157
  measurement["floorsDescended"] = floorsDescended.intValue
162
158
  }
163
159
 
164
- if #available(iOS 9.0, *) {
165
- if let currentPace = data.currentPace {
166
- measurement["currentPace"] = currentPace.doubleValue
167
- }
160
+ if let currentPace = data.currentPace {
161
+ measurement["currentPace"] = currentPace.doubleValue
162
+ }
168
163
 
169
- if let currentCadence = data.currentCadence {
170
- measurement["currentCadence"] = currentCadence.doubleValue
171
- }
164
+ if let currentCadence = data.currentCadence {
165
+ measurement["currentCadence"] = currentCadence.doubleValue
172
166
  }
173
167
 
174
- if #available(iOS 10.0, *) {
175
- if let averageActivePace = data.averageActivePace {
176
- measurement["averageActivePace"] = averageActivePace.doubleValue
177
- }
168
+ if let averageActivePace = data.averageActivePace {
169
+ measurement["averageActivePace"] = averageActivePace.doubleValue
178
170
  }
179
171
 
180
172
  measurement["startDate"] = Int(startDate.timeIntervalSince1970 * 1000)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-pedometer",
3
- "version": "8.0.2",
3
+ "version": "8.0.4",
4
4
  "description": "Capacitor plugin for accessing pedometer data including steps, distance, pace, cadence, and floors",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -44,7 +44,7 @@
44
44
  "lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
45
45
  "fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
46
46
  "eslint": "eslint . --ext .ts",
47
- "prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
47
+ "prettier": "prettier-pretty-check \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
48
48
  "swiftlint": "node-swiftlint",
49
49
  "docgen": "docgen --api CapacitorPedometerPlugin --output-readme README.md --output-json dist/docs.json",
50
50
  "build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
@@ -70,7 +70,8 @@
70
70
  "rimraf": "^6.1.0",
71
71
  "rollup": "^4.53.2",
72
72
  "swiftlint": "^2.0.0",
73
- "typescript": "^5.9.3"
73
+ "typescript": "^5.9.3",
74
+ "prettier-pretty-check": "^0.2.0"
74
75
  },
75
76
  "peerDependencies": {
76
77
  "@capacitor/core": ">=8.0.0"