Modify plugin to make it phonegap 3.0 compatible

This commit is contained in:
Jaime Baez
2013-09-12 11:25:18 +01:00
parent 3572fe7515
commit fd6bddbdc6
4 changed files with 35 additions and 6 deletions

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://cordova.apache.org/ns/plugins/1.0"
id="org.apache.cordova.plugins.PowerManagement"
version="0.1.0">
<name>PowerManagement</name>
<engines>
<engine name="cordova" version=">=2.2.0" />
</engines>
<js-module src="www/powermanagement.js" name="PowerManagement">
<clobbers target="PowerManagement" />
</js-module>
<!-- ios -->
<platform name="ios">
<config-file target="config.xml" parent="/widget">
<feature name="PowerManagement">
<param name="ios-package" value="PowerManagement" />
</feature>
</config-file>
<header-file src="src/ios/PowerManagement.h" />
<source-file src="src/ios/PowerManagement.m" />
</platform>
</plugin>

View File

@@ -35,11 +35,11 @@
/**
* Sets the idleTimerDisable property to true so that the idle timeout is disabled
*/
- (void) acquire:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) acquire:(CDVInvokedUrlCommand*)command;
/**
* Sets the idleTimerDisable property to false so that the idle timeout is enabled
*/
- (void) release:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void) release:(CDVInvokedUrlCommand*)command;
@end

View File

@@ -26,11 +26,11 @@
* Actual implementation of the interface
*/
@implementation PowerManagement
- (void) acquire:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
- (void) acquire:(CDVInvokedUrlCommand*)command
{
CDVPluginResult* result = nil;
NSString* jsString = nil;
NSString* callbackId = [arguments objectAtIndex:0];
NSString* callbackId = command.callbackId;
// Acquire a reference to the local UIApplication singleton
UIApplication* app = [UIApplication sharedApplication];
@@ -50,11 +50,11 @@
}
- (void) release:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options
- (void) release:(CDVInvokedUrlCommand*)command
{
CDVPluginResult* result = nil;
NSString* jsString = nil;
NSString* callbackId = [arguments objectAtIndex:0];
NSString* callbackId = command.callbackId;
// Acquire a reference to the local UIApplication singleton
UIApplication* app = [UIApplication sharedApplication];