Flashlight plugin not working on Nexus 5


#1

I’m trying to use the flashlight plugin, based on the documentation here: http://ngcordova.com/docs/plugins/flashlight/ , but I get nothing. I’ve tried the following, but to no avail:

  • Ensured ngCordova was installed and enabled
    • Downloaded via Bower, added necessary script lines before Cordova, and after Angular, injected into app module, added $cordovaFlashlight to my controller
  • Tested in browser to ensure it was correctly loaded (page loads, plugin fails on ng-click with “flashlight is not defined”, but I knew to expect that, as plugins don’t run in the browser)
  • Ensured android.json had the necessary permissions to access the camera
  • Ran ionic build and ionic run android to run the plugin on a native device
  • Wrapped the call in a try / catch block and alert() the error, if present. Alert shows on browser (obviously), no error on Nexus 5 (running Android 6.0.1)

It looks like there’s a few people who are having this issue too, but there hasn’t been any answers.

Any clues?