CNLiveUserAgreementController.m
1.54 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
//
// CNLiveUserAgreementController.h
// CNLiveUserAgreementManager
//
// Created by 153993236@qq.com on 04/13/2019.
// Copyright (c) 2019 153993236@qq.com. All rights reserved.
//
#import "CNLiveUserAgreementController.h"
#import "WKWebViewJavascriptBridge.h"
#import "CNLiveWebView.h"
@interface CNLiveUserAgreementController ()
@end
@implementation CNLiveUserAgreementController
#pragma mark - 交互
- (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 - Setter方法
- (void)setUrl:(NSString *)url{
if(!url||[url isEqualToString:@""]) return;
[super setUrl:[NSString stringWithFormat:@"%@",url]];
}
#pragma mark - CNLiveWebViewDelegate
- (void)webView:(CNLiveWebView *)webView didFinishLoadWithURL:(NSURL *)url {
NSLog(@"CNLiveUserAgreementController - didFinishLoad");
if(self.title.length == 0){
self.title = webView.title;
}
}
- (void)webView:(CNLiveWebView *)webView didFailLoadWithError:(NSError *)error {
}
@end