YHNativeClickToShow.m
949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// 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