Skip to main content

TorchPlugin.toggleTorch()

BFChainPluginTorchPlugintoggleTorchLess 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/EventAndroidIOSDesktop-DevDesktop
toggleTorchX

TorchPlugin

Comments
  • Latest
  • Oldest
  • Hottest
Powered by Waline v2.15.7