Hello! I have a problem with Flashlight plugin https://build.phonegap.com/plugins/294
It does not work and I do`nt know why, I tried different solutions, but it still not work. And I have strange error in Firefox Firebug:
ReferenceError: cordova is not defined
cordova.addConstructor(Flashlight.install);
How can I fix it? Thanks.
It does not work and I do`nt know why, I tried different solutions, but it still not work. And I have strange error in Firefox Firebug:
ReferenceError: cordova is not defined
cordova.addConstructor(Flashlight.install);
How can I fix it? Thanks.
- 13 Posts
- 0 Reply Likes
Posted 7 years ago
Eddy Verbruggen, Champion
- 375 Posts
- 86 Reply Likes
Hi,
You cant run cordova in firefox. Can we have a look at your code to assist any further?
You cant run cordova in firefox. Can we have a look at your code to assist any further?
- 13 Posts
- 0 Reply Likes
I know that I can`t but maybe this is a way to find source of the problem,
Here is the source code https://drive.google.com/file/d/0B3P5...
Please take alook on it, I hope you find solution
Here is the source code https://drive.google.com/file/d/0B3P5...
Please take alook on it, I hope you find solution
Eddy Verbruggen, Champion
- 375 Posts
- 86 Reply Likes
I assume you are using Phonegap Build for your project. In that case, please follow these steps: https://github.com/EddyVerbruggen/Fla...
The difference is, you include the flashlight.js file in your code, but you need to add
The difference is, you include the flashlight.js file in your code, but you need to add
<script src="js/plugins/Flashlight.js"></script> after phonegap.js.- 13 Posts
- 0 Reply Likes
Oh, I thought that path is not critical, I will try to rebuild app. Thanks.
Eddy Verbruggen, Champion
- 375 Posts
- 86 Reply Likes
Indeed, add the script reference, but don't include the actual js file (same procedure as phonegap.js)
- 13 Posts
- 0 Reply Likes
- 13 Posts
- 0 Reply Likes
Unfortunately it still now works...
- 13 Posts
- 0 Reply Likes
I wrote and don`t include it, tried to write inline javascript but there is no result. I don`t know where is the problem. Maybe you can build app and check what`s wrong?
Eddy Verbruggen, Champion
- 375 Posts
- 86 Reply Likes
Can you update the Google Drive files?
- 13 Posts
- 0 Reply Likes
- 13 Posts
- 0 Reply Likes
I tried script src="js/plugins/Flashlight.js"and script src="Flashlight.js" but no one works
Eddy Verbruggen, Champion
- 375 Posts
- 86 Reply Likes
Use the first option.
And place it AFTER phonegap.js in your index.html please.
And place it AFTER phonegap.js in your index.html please.
- 13 Posts
- 0 Reply Likes
I swaped phonegap.js and Flashlight.js, now it works! It`s was my inattentivness. Thank you Eddy!
- 13 Posts
- 0 Reply Likes
I built my app, it works fine but hava a little bug on Android. When I simply open my app and turn on/off flashlight it works fine, then press back button, app is closing (or not?), open app again, and now when I press "On" button my flashlight don`t work! It begin to work when I press "On" 4-10 times, number of presses is different every time. Do you know what it may be?
P.S. When I clear memory app works fine
P.S. When I clear memory app works fine
- 13 Posts
- 0 Reply Likes
Here is the code https://drive.google.com/file/d/0B3P5...
- 3500 Posts
- 40 Reply Likes
- 13 Posts
- 0 Reply Likes
Hello Zahir,
I still have problems with delay on clicking
Regards
I still have problems with delay on clicking
Regards
Eddy Verbruggen, Champion
- 375 Posts
- 86 Reply Likes
Can you give the new 1.3 version a try?
https://build.phonegap.com/plugins/443
https://build.phonegap.com/plugins/443
- 1 Post
- 0 Reply Likes
I am using the Flashlight plugin. It works but the light turns on only for a second. I tried to increase the time in setTimeout also but no luck. Any ideas?
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers


