Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

vipera-npm-registry / de-splashscreen-plugin   js

Repository URL to install this package:

Version: 0.0.4 

/ src / ios / DESplashScreenPlugin.m

/********* de-core-plugin.m Cordova Plugin Implementation *******/

#import <Cordova/CDV.h>
#import <DEUtility/DEUtils.h>
#import "DESplashScreenPlugin.h"
#import "DESplashScreenManager.h"
#import <DEUtility/DEAppPreferencesUtils.h>
#import "DESplashScreenDefines.h"

@implementation DESplashScreenPlugin

- (void)pluginInitialize
{
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pageDidLoad) name:CDVPageDidLoadNotification object:nil];
    
}

- (void)pageDidLoad
{
    BOOL autoHide = [[DEAppPreferencesUtils sharedInstance] booleanPreferenceForKey:DESPLASH_CFG_PARAM_AUTHIDE withDefaultValue:YES];
    if (autoHide){
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
            [[DESplashScreenManager sharedInstance]hideSplash];
        });
    }
}

- (void)coolMethod:(CDVInvokedUrlCommand*)command
{
    CDVPluginResult* pluginResult = nil;
    NSString* echo = [command.arguments objectAtIndex:0];

    if (echo != nil && [echo length] > 0) {
        pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:echo];
    } else {
        pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
    }

    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

- (void)hideSplash:(CDVInvokedUrlCommand*)command
{
    [[DESplashScreenManager sharedInstance]hideSplash];
}

- (void)showSplash:(CDVInvokedUrlCommand*)command
{
    [[DESplashScreenManager sharedInstance]showSplash];
}

- (void)destroySplash:(CDVInvokedUrlCommand*)command
{
    [[DESplashScreenManager sharedInstance]destroySplash];
}

- (void)isVisible:(CDVInvokedUrlCommand*)command
{
    BOOL isSplashVisible = [[DESplashScreenManager sharedInstance]isSplashVisible];
    CDVPluginResult* pluginResult = nil;
    pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:isSplashVisible];
    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}


@end