Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bau720123 opened this issue Feb 19, 2014 · 6 comments
Open

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

bau720123 opened this issue Feb 19, 2014 · 6 comments

Comments

@bau720123
Copy link

According to this topic
#4

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

@EddyVerbruggen
Copy link
Owner

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

@bau720123
Copy link
Author

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

@bau720123
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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);

@medokin
Copy link

medokin commented Mar 30, 2014

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants