@capgo/capacitor-android-usagestatsmanager 7.2.4 → 7.2.6
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
|
@@ -9,6 +9,17 @@
|
|
|
9
9
|
## Description
|
|
10
10
|
Exposes the Android's UsageStatsManager SDK to Capacitor
|
|
11
11
|
|
|
12
|
+
## Why Android UsageStatsManager?
|
|
13
|
+
|
|
14
|
+
The only plugin exposing Android's **UsageStatsManager API** to Capacitor - this Android API was not supported by any plugin before:
|
|
15
|
+
|
|
16
|
+
- **App usage tracking** - Monitor which apps users open and for how long
|
|
17
|
+
- **Screen time analytics** - Build parental controls and digital wellbeing features
|
|
18
|
+
- **Package information** - Query all installed apps on the device
|
|
19
|
+
- **Time-based queries** - Get usage stats for any time range
|
|
20
|
+
|
|
21
|
+
Perfect for parental control apps, digital wellbeing tools, productivity trackers, and screen time managers.
|
|
22
|
+
|
|
12
23
|
## Usage
|
|
13
24
|
|
|
14
25
|
Requires the following permissions in your `AndroidManifest.xml`:
|
|
@@ -25,7 +25,7 @@ import java.util.Map;
|
|
|
25
25
|
@CapacitorPlugin(name = "CapacitorUsageStatsManager")
|
|
26
26
|
public class CapacitorUsageStatsManagerPlugin extends Plugin {
|
|
27
27
|
|
|
28
|
-
private final String
|
|
28
|
+
private final String pluginVersion = "7.2.6";
|
|
29
29
|
|
|
30
30
|
@PluginMethod
|
|
31
31
|
public void queryAndAggregateUsageStats(final PluginCall call) {
|
|
@@ -167,7 +167,7 @@ public class CapacitorUsageStatsManagerPlugin extends Plugin {
|
|
|
167
167
|
public void getPluginVersion(final PluginCall call) {
|
|
168
168
|
try {
|
|
169
169
|
final JSObject ret = new JSObject();
|
|
170
|
-
ret.put("version", this.
|
|
170
|
+
ret.put("version", this.pluginVersion);
|
|
171
171
|
call.resolve(ret);
|
|
172
172
|
} catch (final Exception e) {
|
|
173
173
|
call.reject("Could not get plugin version", e);
|
|
@@ -7,7 +7,7 @@ import Capacitor
|
|
|
7
7
|
*/
|
|
8
8
|
@objc(CapacitorUsageStatsManagerPlugin)
|
|
9
9
|
public class CapacitorUsageStatsManagerPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
10
|
-
private let
|
|
10
|
+
private let pluginVersion: String = "7.2.6"
|
|
11
11
|
public let identifier = "CapacitorUsageStatsManagerPlugin"
|
|
12
12
|
public let jsName = "CapacitorUsageStatsManager"
|
|
13
13
|
public let pluginMethods: [CAPPluginMethod] = [
|
|
@@ -30,7 +30,7 @@ public class CapacitorUsageStatsManagerPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
@objc func getPluginVersion(_ call: CAPPluginCall) {
|
|
33
|
-
call.resolve(["version": self.
|
|
33
|
+
call.resolve(["version": self.pluginVersion])
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
}
|
package/package.json
CHANGED