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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#include <flutter_boost/FlutterBoostPlugin.h>
#include "ALUpLoadManager.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[GeneratedPluginRegistrant registerWithRegistry:self];
[self flutterMethod];
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
- (void)flutterMethod {
FlutterViewController* controller =
(FlutterViewController*)self.window.rootViewController;
FlutterMethodChannel* buryChannel = [FlutterMethodChannel
methodChannelWithName:@"flutter_bury_channel"
binaryMessenger:controller];
[buryChannel setMethodCallHandler:^(FlutterMethodCall* call,
FlutterResult result) {
NSLog(@" ME %@ argue %@",call.method,call.arguments);
if([call.method isEqualToString:@"FLUTTER_TO_H5"]){
NSLog(@"FLUTTER_TO_H5");
}else if([call.method isEqualToString:@"FLUTTER_TO_NATIVE"]){
NSLog(@"FLUTTER_TO_NATIVE");
}else if ([call.method isEqualToString:@"FLUTTER_BURIED"]){
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
//APPInfo
[dict setObject:@"alpha" forKey:@"app_name"];
[dict setObject:@"app_version_name" forKey:@"app_version_name"];
[dict setObject:@"channel" forKey:@"channel"];
[dict setObject:@"" forKey:@"current_city_id"];
[dict setObject:[[NSMutableDictionary alloc] initWithCapacity:0] forKey:@"user_type"];
[dict setObject:@"" forKey:@"grey_type"];
//DeviceInfo
[dict setObject:@"device_id" forKey:@"device_id"];
[dict setObject:@"Apple" forKey:@"manufacturer"];
[dict setObject:@"lng" forKey:@"lng"];
[dict setObject:@"lat" forKey:@"lat"];
[dict setObject:@"is_WiFi" forKey:@"is_WiFi"];
[dict setObject:@"ip" forKey:@"ip"];
[dict setObject:@"model" forKey:@"model"];
[dict setObject:@"sys_version" forKey:@"sys_version"];
[dict setObject:@"Apple" forKey:@"lng"];
[dict setObject:@"idfa" forKey:@"idfa"];
[dict setObject:@"idfv" forKey:@"idfv"];
[dict setObject:@"user_id" forKey:@"user_id"];
[dict setObject:@"" forKey:@"app_session_id"];
[dict setObject:@"create_at" forKey:@"create_at"];
[dict setObject:@"110" forKey:@"version"];
result(dict);
}else if([call.method isEqualToString:@"GET_NET_TYPE"]){
result(@"wifi");
}else if([call.method isEqualToString:@"INIT_PARAMS"]){
NSMutableDictionary * map=[[NSMutableDictionary alloc] init];
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
[dict setObject:@"sessionid=9odo0sov71x66ke9dlphibnq9i9gduxj;_gtid=3fbe9b78d2cb11e98bc1525400e82fab5270; _gm_token=db88861568285036" forKey:@"cookie"];
[dict setObject:@"debug" forKey:@"buildConfig"];
//HERE
// [dict setObject:@"172.30.9.84:6666" forKey:@"proxy"];
result(dict);
}else if([call.method isEqualToString:@"UPLOAD_IMG"]){
// NSString* path=call.arguments[@"path"];
// NSString* token=call.arguments[@"token"];
// [[ALUpLoadManager shareInstance] setImage:path token:token block:^(NSString *url) {
// result(url);
// NSLog(@"!!!OKK %@",url);
// } failBlock:^(NSString *message) {
// NSLog(@"!!!ERROR %@",message);
// result([FlutterError errorWithCode:@"11" message:message details:message]);
// }];
// NSData *data = [NSData dataWithContentsOfFile:path];
// UIImage * printerImg = [UIImage imageWithData:data];
result(@"2019/10/17/1156/44dbb13ac6d9");
}
}];
}
@end