mirror of
https://github.com/purplecabbage/phonegap-plugins.git
synced 2026-01-09 15:48:00 -05:00
Modify plugin to make it phonegap 3.0 compatible
This commit is contained in:
29
iOS/PowerManagement/plugin.xml
Normal file
29
iOS/PowerManagement/plugin.xml
Normal 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>
|
||||
@@ -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
|
||||
@@ -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];
|
||||
Reference in New Issue
Block a user