fix No visible @interface

master^2
Denis 3 years ago committed by GitHub
parent dc8a177e15
commit ffd2783187
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -25,48 +25,29 @@
@implementation PowerManagement
- (void) acquire:(CDVInvokedUrlCommand*)command
{
CDVPluginResult* result = nil;
NSString* jsString = nil;
NSString* callbackId = command.callbackId;
// Acquire a reference to the local UIApplication singleton
UIApplication* app = [UIApplication sharedApplication];
CDVPluginResult *pluginResult = nil;
if( ![app isIdleTimerDisabled] ) {
[app setIdleTimerDisabled:true];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
jsString = [result toSuccessCallbackString:callbackId];
}
else {
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION messageAsString:@"IdleTimer already disabled"];
jsString = [result toErrorCallbackString:callbackId];
}
[self writeJavascript:jsString];
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}
- (void) release:(CDVInvokedUrlCommand*)command
{
CDVPluginResult* result = nil;
NSString* jsString = nil;
NSString* callbackId = command.callbackId;
// Acquire a reference to the local UIApplication singleton
UIApplication* app = [UIApplication sharedApplication];
CDVPluginResult *pluginResult = nil;
if( [app isIdleTimerDisabled] ) {
[app setIdleTimerDisabled:false];
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
jsString = [result toSuccessCallbackString:callbackId];
}
else {
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ILLEGAL_ACCESS_EXCEPTION messageAsString:@"IdleTimer not disabled"];
jsString = [result toErrorCallbackString:callbackId];
}
[self writeJavascript:jsString];
pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}
@end

Loading…
Cancel
Save