YHNativeClickToShow.m 949 Bytes
//
//  YHNativeClickToShow.m
//  
//
//  Created by gaoqiang xu on 14/9/2015.
//
//

#import "YHNativeClickToShow.h"
#import <UIKit/UIKit.h>
#import <NSData+Base64.h>

NSString * const YHNative_ClickToShowImage = @"YHNativeClickToShow";

@implementation YHNativeClickToShow

- (NSString *)actionName
{
    return YHNative_ClickToShowImage;
}

- (void)clickToShow
{
    if (!self.options || !self.options[@"url"]) {
        self.failureCallBack(@"No picture url detected!");
        return;
    }
    
    NSString *url = self.options[@"url"];
    
    if (url.length == 0) {
        self.failureCallBack(@"No picture data found");
    } else {
//        url = [url stringByReplacingOccurrencesOfString:@"data:image/png;base64," withString:@""];
//        NSData *data = [NSData cdv_dataFromBase64String:url];
//        UIImage *image = [UIImage imageWithData:data];
    }
}

- (NSArray *)availableFunctions
{
    return @[ @"clickToShow" ];
}

@end