TorchPlugin.toggleTorch()
PluginTorchPlugintoggleTorchLess than 1 minute
Turn the flashlight on or off;
TorchPlugin.toggleTorch()
parameters
- none
return value
Return a Promise, resolve to fulfill a boolean;
Example
import { torchPlugin } from "@plaoc/plugins";
;(async () => {
const b = torchPlugin.toggleTorch();
cosole.log(b ? "打开了手电筒": "关闭了手电筒");
})();
Platform Compatibility
Property/Method/Event | Android | IOS | Desktop-Dev | Desktop |
---|---|---|---|---|
toggleTorch | ✅ | ✅ | ✅ | X |
Related Links
Powered by Waline v2.15.7