Software Archive
Read-only legacy content

Flash Light

zahid_s_
Beginner
500 Views

i am  trying to create a flash light but the code is not working. i am testing on iphone 4s. ios 9. i am using this script....

$(document).on("click", ".uib_w_3", function(evt)
    {
        /* your code goes here */ 
        
            window.plugins.flashlight.available(function(isAvailable) {
              if (isAvailable) {
                  window.plugins.flashlight.toggle(function(){
                    alert("Success");
                  }, function(){
                    alert("Failure");
                  });
              } else {
                alert("Flashlight not available on this device");
              }
            });
    });
    
    }

kindly help me to resolve. Thanks in advance. 

0 Kudos
2 Solutions
PaulF_IntelCorp
Employee
500 Views

How are you testing this? It will not work in App Preview (test tab) or in the Emulate tab, because you are using a third-party plugin. To test this on an iOS device you'll need to build the app and run it on a real device. For Android, you can use the Debug tab. See this doc page > https://software.intel.com/en-us/xdk/docs/intel-xdk-debug-and-test-overview

View solution in original post

0 Kudos
Elroy_A_Intel
Employee
500 Views

I recommend submitting an issue request on the plugin developer's Github page . This plugin may have a limitation per device and operating systems.

View solution in original post

0 Kudos
2 Replies
PaulF_IntelCorp
Employee
501 Views

How are you testing this? It will not work in App Preview (test tab) or in the Emulate tab, because you are using a third-party plugin. To test this on an iOS device you'll need to build the app and run it on a real device. For Android, you can use the Debug tab. See this doc page > https://software.intel.com/en-us/xdk/docs/intel-xdk-debug-and-test-overview

0 Kudos
Elroy_A_Intel
Employee
501 Views

I recommend submitting an issue request on the plugin developer's Github page . This plugin may have a limitation per device and operating systems.

0 Kudos
Reply