Commit ce5581ebe9a7fc5d63c72e2fe0e2c983b72cd852

Authored by 张旭
1 parent a7a9ffbc

增加渠道ID, 更改版本2.2.0

CNLiveUserSystemDemo/AppDelegate.m
@@ -27,6 +27,7 @@ @@ -27,6 +27,7 @@
27 27
28 [CNLiveUserSystemCenter setAppId:AppId appKey:AppKey appSecret:AppSceret]; 28 [CNLiveUserSystemCenter setAppId:AppId appKey:AppKey appSecret:AppSceret];
29 29
  30 + [CNLiveUserSystemCenter setFromID:@"ffylTest"];
30 [WXApi registerApp:WeChatAppKey]; 31 [WXApi registerApp:WeChatAppKey];
31 [WeiboSDK enableDebugMode:YES]; 32 [WeiboSDK enableDebugMode:YES];
32 [WeiboSDK registerApp:SinaAppKey]; 33 [WeiboSDK registerApp:SinaAppKey];
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUserManager.h
@@ -16,7 +16,8 @@ @@ -16,7 +16,8 @@
16 @property (nonatomic, strong) NSString *appSecret; 16 @property (nonatomic, strong) NSString *appSecret;
17 @property (nonatomic ,assign) BOOL isTestEnvironment; 17 @property (nonatomic ,assign) BOOL isTestEnvironment;
18 @property (nonatomic, copy) NSString *userId; 18 @property (nonatomic, copy) NSString *userId;
19 - 19 +/** 渠道id */
  20 +@property (nonatomic, copy) NSString *fromID;
20 + (CNLiveUserManager *)manager; 21 + (CNLiveUserManager *)manager;
21 22
22 - (void)addObserver; 23 - (void)addObserver;
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUserManager.m
@@ -48,7 +48,7 @@ @@ -48,7 +48,7 @@
48 NSString *stamp = realTime; 48 NSString *stamp = realTime;
49 stamp = [stamp stringByReplacingOccurrencesOfString:@"." withString:@""]; 49 stamp = [stamp stringByReplacingOccurrencesOfString:@"." withString:@""];
50 NSString *baseUrl = formalStatUrl; 50 NSString *baseUrl = formalStatUrl;
51 - NSString *vvUrl = [NSString stringWithFormat:@"%@?sver=%@&uid=%@&tm=%@&from=apple&spid=&appid=%@&version=1005_%@&eventid=1300&uri=&sid=&plat=i_%@&objid=",baseUrl,kSVer,[CNLiveUserSystemTools uidForStat:realTime],stamp,self.appId,SDKVersion, StatAppVersion]; 51 + NSString *vvUrl = [NSString stringWithFormat:@"%@?sver=%@&uid=%@&tm=%@&from=%@&spid=&appid=%@&version=1005_%@&eventid=1300&uri=&sid=&plat=i_%@&objid=",baseUrl,kSVer,[CNLiveUserSystemTools uidForStat:realTime],stamp,[CNLiveUserManager manager].fromID?[CNLiveUserManager manager].fromID: @"apple",self.appId,SDKVersion, StatAppVersion];
52 52
53 [NSURLConnection connectionWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:vvUrl]] delegate:nil]; 53 [NSURLConnection connectionWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:vvUrl]] delegate:nil];
54 54
@@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
65 NSString *endDate = [NSString stringWithFormat:@"%.3f",[netDate timeIntervalSinceDate:_startDate]]; 65 NSString *endDate = [NSString stringWithFormat:@"%.3f",[netDate timeIntervalSinceDate:_startDate]];
66 endDate = [endDate stringByReplacingOccurrencesOfString:@"." withString:@""]; 66 endDate = [endDate stringByReplacingOccurrencesOfString:@"." withString:@""];
67 NSString *baseUrl = formalStatUrl; 67 NSString *baseUrl = formalStatUrl;
68 - NSString *vvUrl = [NSString stringWithFormat:@"%@?sver=%@&uid=%@&tm=%@&from=apple&spid=&appid=%@&version=1005_%@&eventid=1311&uri=%@&sid=&plat=i_%@&objid=",baseUrl,kSVer,[CNLiveUserSystemTools uidForStat:realTime],stamp,self.appId,SDKVersion,endDate,StatAppVersion]; 68 + NSString *vvUrl = [NSString stringWithFormat:@"%@?sver=%@&uid=%@&tm=%@&from=%@&spid=&appid=%@&version=1005_%@&eventid=1311&uri=%@&sid=&plat=i_%@&objid=",baseUrl,kSVer,[CNLiveUserSystemTools uidForStat:realTime],stamp,[CNLiveUserManager manager].fromID?[CNLiveUserManager manager].fromID: @"apple",self.appId,SDKVersion,endDate,StatAppVersion];
69 69
70 [NSURLConnection connectionWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:vvUrl]] delegate:nil]; 70 [NSURLConnection connectionWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:vvUrl]] delegate:nil];
71 }]; 71 }];
@@ -80,7 +80,7 @@ @@ -80,7 +80,7 @@
80 NSString *stamp = realTime; 80 NSString *stamp = realTime;
81 stamp = [stamp stringByReplacingOccurrencesOfString:@"." withString:@""]; 81 stamp = [stamp stringByReplacingOccurrencesOfString:@"." withString:@""];
82 NSString *baseUrl = formalStatUrl; 82 NSString *baseUrl = formalStatUrl;
83 - NSString *vvUrl = [NSString stringWithFormat:@"%@?sver=%@&uid=%@&tm=%@&from=apple&spid=&appid=%@&version=1005_%@&eventid=1320&uri=&sid=%@&plat=i_%@&objid=",baseUrl,kSVer,[CNLiveUserSystemTools uidForStat:realTime],stamp,self.appId,SDKVersion, [CNLiveUserManager manager].userId ? [CNLiveUserManager manager].userId: @"",StatAppVersion]; 83 + NSString *vvUrl = [NSString stringWithFormat:@"%@?sver=%@&uid=%@&tm=%@&from=%@&spid=&appid=%@&version=1005_%@&eventid=1320&uri=&sid=%@&plat=i_%@&objid=",baseUrl,kSVer,[CNLiveUserSystemTools uidForStat:realTime],stamp,[CNLiveUserManager manager].fromID?[CNLiveUserManager manager].fromID: @"apple",self.appId,SDKVersion, [CNLiveUserManager manager].userId ? [CNLiveUserManager manager].userId: @"",StatAppVersion];
84 NSLog(@"url start:\n%@",vvUrl); 84 NSLog(@"url start:\n%@",vvUrl);
85 [NSURLConnection connectionWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:vvUrl]] delegate:nil]; 85 [NSURLConnection connectionWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:vvUrl]] delegate:nil];
86 86
@@ -101,7 +101,7 @@ @@ -101,7 +101,7 @@
101 101
102 102
103 103
104 - NSString *vvUrl = [NSString stringWithFormat:@"%@?sver=%@&uid=%@&tm=%@&from=apple&spid=&appid=%@&version=1005_%@&eventid=1321&uri=%@&sid=%@&plat=i_%@&objid=",baseUrl,kSVer,[CNLiveUserSystemTools uidForStat:realTime],stamp,self.appId,SDKVersion,endDate,[CNLiveUserManager manager].userId ? [CNLiveUserManager manager].userId: @"",StatAppVersion]; 104 + NSString *vvUrl = [NSString stringWithFormat:@"%@?sver=%@&uid=%@&tm=%@&from=%@&spid=&appid=%@&version=1005_%@&eventid=1321&uri=%@&sid=%@&plat=i_%@&objid=",baseUrl,kSVer,[CNLiveUserSystemTools uidForStat:realTime],stamp,[CNLiveUserManager manager].fromID?[CNLiveUserManager manager].fromID: @"apple",self.appId,SDKVersion,endDate,[CNLiveUserManager manager].userId ? [CNLiveUserManager manager].userId: @"",StatAppVersion];
105 NSLog(@"url end:\n%@",vvUrl); 105 NSLog(@"url end:\n%@",vvUrl);
106 [NSURLConnection connectionWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:vvUrl]] delegate:nil]; 106 [NSURLConnection connectionWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:vvUrl]] delegate:nil];
107 }]; 107 }];
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUserSystemCenter.h
@@ -31,6 +31,13 @@ @@ -31,6 +31,13 @@
31 + (void)setUserId:(NSString *)userId; 31 + (void)setUserId:(NSString *)userId;
32 32
33 /** 33 /**
  34 + 渠道ID
  35 +
  36 + @param fromID 渠道ID
  37 + */
  38 ++ (void)setFromID:(NSString *)fromID;
  39 +
  40 +/**
34 @abstract 初始化 41 @abstract 初始化
35 @param appId 注册成功获得应用ID 42 @param appId 注册成功获得应用ID
36 @param appKey 注册成功获得应用key 43 @param appKey 注册成功获得应用key
@@ -332,7 +339,7 @@ @@ -332,7 +339,7 @@
332 339
333 340
334 /** 341 /**
335 - * 获取SDK版本号 v2.1.0 342 + * 获取SDK版本号 v2.2.0
336 */ 343 */
337 + (NSString *)getVersion; 344 + (NSString *)getVersion;
338 345
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUserSystemCenter.m
@@ -55,6 +55,11 @@ @@ -55,6 +55,11 @@
55 [CNLiveUserManager manager].userId = userId; 55 [CNLiveUserManager manager].userId = userId;
56 } 56 }
57 57
  58 ++ (void)setFromID:(NSString *)fromID
  59 +{
  60 + [CNLiveUserManager manager].fromID = fromID;
  61 +}
  62 +
58 /** 63 /**
59 * 注册 64 * 注册
60 */ 65 */
CNLiveUserSystemDemo/CNLiveUserSystemSDK/CNLiveUserSystemTools.m
@@ -120,7 +120,7 @@ @@ -120,7 +120,7 @@
120 NSString *stamp = realTime; 120 NSString *stamp = realTime;
121 stamp = [stamp stringByReplacingOccurrencesOfString:@"." withString:@""]; 121 stamp = [stamp stringByReplacingOccurrencesOfString:@"." withString:@""];
122 NSString *baseUrl = self.isTestEnvironment ? formalStatUrl : testStatUrl; 122 NSString *baseUrl = self.isTestEnvironment ? formalStatUrl : testStatUrl;
123 - NSString *vvUrl = [NSString stringWithFormat:@"%@?sver=%@&uid=%@&tm=%@&from=apple&spid=&appid=%@&version=1005_%@&eventid=1000&uri=%@&sid=%@&plat=i_%@&objid=_",baseUrl,kSVer, [self uidForStat:realTime], stamp, [CNLiveUserManager manager].appId, SDKVersion, errorString,[self getSid],StatAppVersion]; 123 + NSString *vvUrl = [NSString stringWithFormat:@"%@?sver=%@&uid=%@&tm=%@&from=%@&spid=&appid=%@&version=1005_%@&eventid=1000&uri=%@&sid=%@&plat=i_%@&objid=_",baseUrl,kSVer, [self uidForStat:realTime], stamp,[CNLiveUserManager manager].fromID?[CNLiveUserManager manager].fromID: @"apple", [CNLiveUserManager manager].appId, SDKVersion, errorString,[self getSid],StatAppVersion];
124 [NSURLConnection connectionWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:vvUrl]] delegate:nil]; 124 [NSURLConnection connectionWithRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:vvUrl]] delegate:nil];
125 }]; 125 }];
126 } 126 }
CNLiveUserSystemDemo/CNLiveUserSystemSDK/Common.h
@@ -11,6 +11,6 @@ @@ -11,6 +11,6 @@
11 11
12 #define kSVer @"4.0" //探针版本 12 #define kSVer @"4.0" //探针版本
13 #define StatAppVersion ([[[NSBundle mainBundle] infoDictionary] objectForKey: @"CFBundleShortVersionString"]) 13 #define StatAppVersion ([[[NSBundle mainBundle] infoDictionary] objectForKey: @"CFBundleShortVersionString"])
14 -#define SDKVersion @"2.1.0" //SDK版本 14 +#define SDKVersion @"2.2.0" //SDK版本
15 15
16 #endif /* Common_h */ 16 #endif /* Common_h */