@capgo/capacitor-flash 7.1.8 → 7.1.10
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
|
@@ -7,6 +7,19 @@
|
|
|
7
7
|
</div>
|
|
8
8
|
Switch the Flashlight / Torch of your device.
|
|
9
9
|
|
|
10
|
+
## Why Capacitor Flash?
|
|
11
|
+
|
|
12
|
+
A simple, **free**, and **lightweight** flashlight control plugin:
|
|
13
|
+
|
|
14
|
+
- **Intensity control** - Adjust brightness levels (iOS with configurable intensity)
|
|
15
|
+
- **Status checking** - Query flashlight availability and current state
|
|
16
|
+
- **Toggle support** - Simple on/off switching with toggle method
|
|
17
|
+
- **Universal compatibility** - Works across all iOS and Android devices with flash hardware
|
|
18
|
+
- **Modern package management** - Supports both Swift Package Manager (SPM) and CocoaPods (SPM-ready for Capacitor 8)
|
|
19
|
+
- **Zero dependencies** - Minimal footprint, no bloat
|
|
20
|
+
|
|
21
|
+
Perfect for QR scanner apps, emergency torch features, camera apps, and utility tools.
|
|
22
|
+
|
|
10
23
|
## Documentation
|
|
11
24
|
|
|
12
25
|
The most complete doc is available here: https://capgo.app/docs/plugins/flash/
|
|
@@ -19,7 +19,7 @@ import com.getcapacitor.annotation.PermissionCallback;
|
|
|
19
19
|
@CapacitorPlugin(name = "CapacitorFlash", permissions = { @Permission(alias = "camera", strings = { Manifest.permission.CAMERA }) })
|
|
20
20
|
public class CapacitorFlashPlugin extends Plugin {
|
|
21
21
|
|
|
22
|
-
private final String
|
|
22
|
+
private final String pluginVersion = "7.1.10";
|
|
23
23
|
|
|
24
24
|
private String cameraId;
|
|
25
25
|
boolean isFlashStateOn = false;
|
|
@@ -137,7 +137,7 @@ public class CapacitorFlashPlugin extends Plugin {
|
|
|
137
137
|
public void getPluginVersion(final PluginCall call) {
|
|
138
138
|
try {
|
|
139
139
|
final JSObject ret = new JSObject();
|
|
140
|
-
ret.put("version", this.
|
|
140
|
+
ret.put("version", this.pluginVersion);
|
|
141
141
|
call.resolve(ret);
|
|
142
142
|
} catch (final Exception e) {
|
|
143
143
|
call.reject("Could not get plugin version", e);
|
|
@@ -7,7 +7,7 @@ import Capacitor
|
|
|
7
7
|
*/
|
|
8
8
|
@objc(CapacitorFlashPlugin)
|
|
9
9
|
public class CapacitorFlashPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
10
|
-
private let
|
|
10
|
+
private let pluginVersion: String = "7.1.10"
|
|
11
11
|
public let identifier = "CapacitorFlashPlugin"
|
|
12
12
|
public let jsName = "CapacitorFlash"
|
|
13
13
|
public let pluginMethods: [CAPPluginMethod] = [
|
|
@@ -53,7 +53,7 @@ public class CapacitorFlashPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
@objc func getPluginVersion(_ call: CAPPluginCall) {
|
|
56
|
-
call.resolve(["version": self.
|
|
56
|
+
call.resolve(["version": self.pluginVersion])
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
}
|