Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Cap-go/capacitor-flash
Switch the Flashlight / Torch of your device.
https://github.com/Cap-go/capacitor-flash
android capacitor ionic ios typescript
Last synced: 24 days ago
JSON representation
Switch the Flashlight / Torch of your device.
- Host: GitHub
- URL: https://github.com/Cap-go/capacitor-flash
- Owner: Cap-go
- Created: 2021-11-15T03:25:25.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-12T21:09:46.000Z (10 months ago)
- Last Synced: 2024-04-14T00:50:14.144Z (8 months ago)
- Topics: android, capacitor, ionic, ios, typescript
- Language: Java
- Homepage:
- Size: 498 KB
- Stars: 11
- Watchers: 2
- Forks: 4
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
- awesome-capacitorjs - @capgo/capacitor-flash - Switch the Flashlight / Torch of your device. (Plugins / Community Plugins)
- awesome-capacitor - Flash - Switch the Flashlight / Torch of your device. ([Capgo plugins](https://capgo.app/))
README
➡️ Get Instant updates for your App with Capgo 🚀
Fix your annoying bug now, Hire a Capacitor expert 💪
Switch the Flashlight / Torch of your device.
## Install
```bash
npm install @capgo/capacitor-flash
npx cap sync
```## iOS
Works out of the box
## Android
1. Declare permissions in your app's `AndroidManifest.xml` file
```xml
```
## API
* [`isAvailable()`](#isavailable)
* [`switchOn(...)`](#switchon)
* [`switchOff()`](#switchoff)
* [`isSwitchedOn()`](#isswitchedon)
* [`toggle()`](#toggle)### isAvailable()
```typescript
isAvailable() => any
```Checks if flashlight is available
**Returns:**
any
--------------------
### switchOn(...)
```typescript
switchOn(options: { intensity?: number; }) => any
```Turns the flashlight on
| Param | Type |
| ------------- | ------------------------------------ |
| **`options`** |{ intensity?: number; }
|**Returns:**
any
--------------------
### switchOff()
```typescript
switchOff() => any
```Turns the flashlight off
**Returns:**
any
--------------------
### isSwitchedOn()
```typescript
isSwitchedOn() => any
```Checks if the flashlight is turned on or off
**Returns:**
any
--------------------
### toggle()
```typescript
toggle() => any
```Toggle the flashlight
**Returns:**
any
--------------------