@capgo/capacitor-accelerometer 7.1.2 → 7.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/README.md
CHANGED
|
@@ -11,6 +11,18 @@ Access raw accelerometer measurements across iOS, Android, and the Web.
|
|
|
11
11
|
|
|
12
12
|
WIP: the plugin is not yet ready for production
|
|
13
13
|
|
|
14
|
+
## Why Capacitor Accelerometer?
|
|
15
|
+
|
|
16
|
+
The only **free** and **maintained** Capacitor plugin for accelerometer access. Other plugins are either paid or no longer updated. This plugin provides:
|
|
17
|
+
|
|
18
|
+
- **Up-to-date implementation** - Uses the latest APIs across all platforms
|
|
19
|
+
- **Consistent JavaScript API** - Same interface as popular paid alternatives
|
|
20
|
+
- **Cross-platform** - Works on iOS, Android, and Web
|
|
21
|
+
- **Permission handling** - Built-in permission management
|
|
22
|
+
- **Real-time streaming** - Listen to continuous accelerometer updates
|
|
23
|
+
|
|
24
|
+
Perfect for fitness apps, games, gesture detection, and motion-based interfaces.
|
|
25
|
+
|
|
14
26
|
## Documentation
|
|
15
27
|
|
|
16
28
|
The most complete doc is available here: https://capgo.app/docs/plugins/accelerometer/
|
|
@@ -15,7 +15,7 @@ import com.getcapacitor.annotation.CapacitorPlugin;
|
|
|
15
15
|
@CapacitorPlugin(name = "CapacitorAccelerometer")
|
|
16
16
|
public class CapacitorAccelerometerPlugin extends Plugin implements SensorEventListener {
|
|
17
17
|
|
|
18
|
-
private final String
|
|
18
|
+
private final String pluginVersion = "7.1.4";
|
|
19
19
|
private static final String PERMISSION_GRANTED = "granted";
|
|
20
20
|
private static final String PERMISSION_DENIED = "denied";
|
|
21
21
|
|
|
@@ -163,7 +163,7 @@ public class CapacitorAccelerometerPlugin extends Plugin implements SensorEventL
|
|
|
163
163
|
public void getPluginVersion(final PluginCall call) {
|
|
164
164
|
try {
|
|
165
165
|
final JSObject ret = new JSObject();
|
|
166
|
-
ret.put("version", this.
|
|
166
|
+
ret.put("version", this.pluginVersion);
|
|
167
167
|
call.resolve(ret);
|
|
168
168
|
} catch (final Exception e) {
|
|
169
169
|
call.reject("Could not get plugin version", e);
|
|
@@ -4,7 +4,7 @@ import Foundation
|
|
|
4
4
|
|
|
5
5
|
@objc(CapacitorAccelerometerPlugin)
|
|
6
6
|
public class CapacitorAccelerometerPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
7
|
-
private let
|
|
7
|
+
private let pluginVersion: String = "7.1.4"
|
|
8
8
|
public let identifier = "CapacitorAccelerometerPlugin"
|
|
9
9
|
public let jsName = "CapacitorAccelerometer"
|
|
10
10
|
public let pluginMethods: [CAPPluginMethod] = [
|
|
@@ -115,6 +115,6 @@ public class CapacitorAccelerometerPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
@objc func getPluginVersion(_ call: CAPPluginCall) {
|
|
118
|
-
call.resolve(["version": self.
|
|
118
|
+
call.resolve(["version": self.pluginVersion])
|
|
119
119
|
}
|
|
120
120
|
}
|