How do I call handles for XDK Cordova Hybrid plugins?

Get help using Construct 2

Post » Mon Jul 18, 2016 12:41 am

In Intel XDK I added the Insomnia plugin to prevent the screen from sleeping during game play. In the instructions it says:

"The device will never fall asleep after calling keepAwake."
".....you can allow it to sleep again by calling allowSleepAgain."


My question is how do I call keepAwake and allowSleepAgain?

To me it seems like it will have to be an event in Construct 2. Otherwise the plugin won't know when to keep awake or to allow sleep. I plan on adding a counter that will reset every time the screen is touched. If the counter gets to a certain number it will be allowed to sleep.

I am wanting to know how do I use Handles for plugins, or I need to be pointed into the proper direction if I am going about it wrong.

I am also wanting to know if Caps matter when calling the plugin's handles.
As in will using KeepAwake instead of keepAwake make the plugin not work, or will depend on the plugin?
B
67
S
37
G
13
Posts: 241
Reputation: 12,760

Post » Mon Jul 18, 2016 12:34 pm

B
19
S
6
G
2
Posts: 260
Reputation: 2,653

Post » Mon Jul 18, 2016 5:15 pm

Thanks I will use this, it seems better anyway.

I still need to know how to call XDK Plugins for later when/if I come across this again.
B
67
S
37
G
13
Posts: 241
Reputation: 12,760

Post » Mon Jul 18, 2016 5:58 pm

You need to use the C2 Browser object, and call the function you need with Execute Javascript option ^^
B
19
S
6
G
2
Posts: 260
Reputation: 2,653

Post » Mon Jul 18, 2016 9:18 pm

Okay thank you for your time and the plugin. Both were very useful. ;)
B
67
S
37
G
13
Posts: 241
Reputation: 12,760


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests