CNLIVEViewController.m
1.51 KB
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
46
47
48
49
50
51
52
53
54
55
56
//
// CNLIVEViewController.m
// CNLiveBalanceModule
//
// Created by 153993236@qq.com on 12/09/2019.
// Copyright (c) 2019 153993236@qq.com. All rights reserved.
//
#import "CNLIVEViewController.h"
#import "WKWebViewJavascriptBridge.h"
#import "CNLiveWebView.h"
@interface CNLIVEViewController ()
@end
@implementation CNLIVEViewController
- (void)createSubViews {
[super createSubViews];
[self interaction];
}
- (void)interaction {
[super interaction];
[self.bridge registerHandler:@"wjjHelpAndFeedbackImage" handler:^(id data, WVJBResponseCallback responseCallback) {
NSLog(@"ObjC Echo called with: %@", data);
responseCallback(data);
}];
id dataDic = @{
// @"imagePath": imagePath,
@"image" : @"asd"
};
// 帮助与反馈->产品建议:App提交图片数据给h5展示
[self.bridge callHandler:@"wjjCommitImageToJS" data:dataDic responseCallback:^(id responseData) {
NSLog(@"ObjC received response: %@", responseData);
}];
}
#pragma mark - CNLiveWebViewDelegate
- (void)webView:(CNLiveWebView *)webView didFinishLoadWithURL:(NSURL *)url {
NSLog(@"CNLIVEViewController - didFinishLoad");
if(self.title.length == 0){
self.title = webView.title;
}
}
- (void)webView:(CNLiveWebView *)webView didFailLoadWithError:(NSError *)error{
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end