Flashlight-PhoneGap-Plugin icon indicating copy to clipboard operation
Flashlight-PhoneGap-Plugin copied to clipboard

Found a issue with your plugin BY 1.1 or 1.3 or 1.4 version

Open bau720123 opened this issue 11 years ago • 6 comments

According to this topic https://github.com/EddyVerbruggen/Flashlight-PhoneGap-Plugin/issues/4

it seem the "available" function was broken on 1.1 until 1.4 now,only the 1.0 version is worked~

bau720123 avatar Feb 19 '14 08:02 bau720123

See #4: please send me your code and I will have a look.

EddyVerbruggen avatar Feb 19 '14 18:02 EddyVerbruggen

HI @EddyVerbruggen I have already send a email to you tks~

bau720123 avatar Feb 20 '14 05:02 bau720123

Hi @EddyVerbruggen The 1.4.1 version appear,and it seem solve my problem,tks~ https://build.phonegap.com/plugins/501 I will close this topic by myself

bau720123 avatar Mar 02 '14 08:03 bau720123

Hi @EddyVerbruggen I found a strange problem in 1.4.1 (1.0 have no this situation),and you told me that will fixed in 1.4.1 but seem not~ (by email XD)

this is my code

window.plugins.flashlight.available(function(isAvailable)
{
 if(isAvailable == true)
 {
 window.plugins.flashlight.switchOn(function() { alert('turn on success'); }, function() { alert('turn on fail'); });
 setTimeout(function() { window.plugins.flashlight.switchOff(function() { alert('turn off success'); }, function() { alert('turn off fail'); }); }, 3000);
 }
});

1.0 first Execution,the light will turn on second Execution,the light will turn off ....

1.4.1 first Execution,the light seem not turn on (because of I can't see any Light) second Execution,the light will turn on (I can see the light) third Execution,the light will turn of forth...turn on Fifth...turn off ....

bau720123 avatar Mar 03 '14 15:03 bau720123

hi @EddyVerbruggen I found a way to solve this situation in 1.4.1,don't put the main code at isAvailable inner

window.plugins.flashlight.available(function(isAvailable)
{
 if(isAvailable == true)
 {
 //don't put your code at here,but if I use alert(isAvailable),it will show "true"(it is correct),so strange in 1.4.1
 }
});

//just put your code outside
window.plugins.flashlight.switchOn(function() { alert('turn on success'); }, function() { alert('turn on fail'); });
 setTimeout(function() { window.plugins.flashlight.switchOff(function() { alert('turn off success'); }, function() { alert('turn off fail'); }); }, 3000);

bau720123 avatar Mar 16 '14 11:03 bau720123

+1

medokin avatar Mar 30 '14 17:03 medokin