EddyVerbruggen / Insomnia-PhoneGap-Plugin

:sleepy: Prevent the screen of the mobile device from falling asleep
264 stars 106 forks source link

Unable to Install in phone gap Build #9

Closed ARIHANT-MEDIA closed 10 years ago

ARIHANT-MEDIA commented 10 years ago

Hello Can you help me with step to use this pluging in Phone Gap. I have installed this in congif.xml file as under (used [ ] intead of < >)

[?xml version="1.0" encoding="UTF-8" ?] [widget xmlns = "http://www.w3.org/ns/widgets" xmlns:gap = "http://phonegap.com/ns/1.0" id = "com.arihantmedia.tirthankardarshnaawali" version = "1.1.3" versionCode = "10" ]

[gap:plugin name="nl.x-services.plugins.socialsharing" version="4.0.8" /] [gap:plugin name="nl.x-services.plugins.insomnia"]

[preference name="phonegap-version" value="3.3.0" /]

But this does not worked in my project.

Should I have to do any thing more or I am doing any wrong. Please help me. Thanks in advance !

EddyVerbruggen commented 10 years ago

Have you added a bit of javascript as well, to trigger the plugin? Merely including the plugin in config.xml is not sufficient ;)

ARIHANT-MEDIA commented 10 years ago

Ok I have not added java script as it is mentioned in Phone Gap Installation that "The required javascript file is brought in automatically. There is no need to change or add anything in your html." on https://github.com/EddyVerbruggen/Insomnia-PhoneGap-Plugin/tree/47ba15a4ad791eb4d5a0643cdb7ef69f73109e15

Now will do with adding java script file and notify if any issue or not.

Thanks !

EddyVerbruggen commented 10 years ago

Sorry, that is not what I meant: you don't need to include the JS file, you need to add this JS code (also mentioned in the readme):

<button onclick="window.plugins.insomnia.keepAwake()">keep awake</button>
ARIHANT-MEDIA commented 10 years ago

Ok I have to include this in head tag. and should I have to use this on every page or only in Index Page

bilejn commented 10 years ago

I included the line in xml and in head section for .js file and added commands in the code - still not working. What could be wrong? I did not use it with button but in the separate function, but it should not be the problem?

ARIHANT-MEDIA commented 10 years ago

I also not succeed to add this plugin in my app till now. I have asked here and also asked to phonegap build but not got any satisfied reply which works. I don't know actually this plugin works or not...?

EddyVerbruggen commented 10 years ago

Please send me your project and I will have a look. Mail it to eddyverbruggen at gmail

ARIHANT-MEDIA commented 10 years ago

Hello Sir, I have mailed you the sample project file of both INSOMNIA and SOCIAL SHARING plugings I have used in it. Please check and revert me with your suggestions.

my mail is 'info at arihantmedia dot com'

Thanks in advance... !

bilejn commented 10 years ago

I made a mistake, I forgot to include phonegap.js in head section of index.html. Now everything is ok. This plugin works perfectly. Thanks

ARIHANT-MEDIA commented 10 years ago

Great ! I love this as it works...! Thanks a lot.

I have a suggestion for your plugins...

please add adding of

[script src="cordova.js"[ ]/script]

in your installation guide it will help so many beginners to install all these plugins easily. (I have faced this problem that's why I am saying)

Thanks a lot again...

EddyVerbruggen commented 10 years ago

Thanks for the suggestion. Adding it right now.