Commit f63c1510aa80c5d8b194d7118a942dda76fb12ce

Authored by zhangxiaowen
1 parent f4cf82ef

no message

CNLiveEnvironment/Classes/CNLiveEnvironment.h
@@ -8,7 +8,11 @@ @@ -8,7 +8,11 @@
8 8
9 #ifndef CNLiveEnvironment_h 9 #ifndef CNLiveEnvironment_h
10 #define CNLiveEnvironment_h 10 #define CNLiveEnvironment_h
  11 +
  12 +// 接口
11 #import "CNLiveInterface.h" 13 #import "CNLiveInterface.h"
  14 +
  15 +// 常量
12 #import "CNLiveConst.h" 16 #import "CNLiveConst.h"
13 17
14 // 详细环境 18 // 详细环境
@@ -17,7 +21,7 @@ @@ -17,7 +21,7 @@
17 // 是否是测试环境 21 // 是否是测试环境
18 #define TestEnvironment [CNLiveEnvironmentManager manager].isTestEnvironment 22 #define TestEnvironment [CNLiveEnvironmentManager manager].isTestEnvironment
19 23
20 -// Url域名 24 +// 下载Url
21 #define AppDownloadUrl [CNLiveEnvironmentManager manager].kAppDownloadUrl 25 #define AppDownloadUrl [CNLiveEnvironmentManager manager].kAppDownloadUrl
22 26
23 #define WjjH5_Host [CNLiveEnvironmentManager manager].kWjjH5_Host 27 #define WjjH5_Host [CNLiveEnvironmentManager manager].kWjjH5_Host
@@ -95,5 +99,4 @@ @@ -95,5 +99,4 @@
95 // 银联支付Schems 99 // 银联支付Schems
96 #define NetAddTestUnionPaySchems [CNLiveEnvironmentManager manager].kNetAddTestUnionPaySchems 100 #define NetAddTestUnionPaySchems [CNLiveEnvironmentManager manager].kNetAddTestUnionPaySchems
97 101
98 -  
99 #endif /* CNLiveEnvironment_h */ 102 #endif /* CNLiveEnvironment_h */
CNLiveEnvironment/Classes/CNLiveEnvironmentManager.m
@@ -106,6 +106,22 @@ static CNLiveEnvironmentManager *_instance = nil; @@ -106,6 +106,22 @@ static CNLiveEnvironmentManager *_instance = nil;
106 return _instance; 106 return _instance;
107 } 107 }
108 108
  109 ++ (id)allocWithZone:(struct _NSZone *)zone{
  110 + static dispatch_once_t onceToken;
  111 + dispatch_once(&onceToken, ^{
  112 + _instance = [super allocWithZone:zone];
  113 + });
  114 + return _instance;
  115 +}
  116 +
  117 +- (nonnull id)copyWithZone:(nullable NSZone *)zone {
  118 + return _instance;
  119 +}
  120 +
  121 +- (nonnull id)mutableCopyWithZone:(nullable NSZone *)zone {
  122 + return _instance;
  123 +}
  124 +
109 /** 125 /**
110 * @abstract 初始化配置 126 * @abstract 初始化配置
111 * @param isEnvironment 环境 127 * @param isEnvironment 环境
Example/CNLiveEnvironment/XWAppDelegate.m
@@ -7,12 +7,17 @@ @@ -7,12 +7,17 @@
7 // 7 //
8 8
9 #import "XWAppDelegate.h" 9 #import "XWAppDelegate.h"
  10 +#import "CNLiveEnvironment.h"
10 11
11 @implementation XWAppDelegate 12 @implementation XWAppDelegate
12 13
13 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
14 { 15 {
15 16
  17 + NSLog(@"%@",EnvironmentDesc);
  18 + NSLog(@"%@",DisplayName);
  19 +
  20 + [CNLiveEnvironmentManager setEnvironment:CNLiveDebugInHouse];
16 return YES; 21 return YES;
17 } 22 }
18 23
Example/CNLiveEnvironment/XWViewController.m
@@ -19,16 +19,13 @@ @@ -19,16 +19,13 @@
19 { 19 {
20 [super viewDidLoad]; 20 [super viewDidLoad];
21 // Do any additional setup after loading the view, typically from a nib. 21 // Do any additional setup after loading the view, typically from a nib.
22 - NSLog(@"%@",TIM_GetTokenUrl);  
23 - NSLog(@"%d",TestEnvironment);  
24 - NSLog(@"%@",AppId); 22 + NSLog(@"%@",EnvironmentDesc);
  23 + NSLog(@"%@",DisplayName);
25 24
26 [CNLiveEnvironmentManager setEnvironment:CNLiveProductionAppStore]; 25 [CNLiveEnvironmentManager setEnvironment:CNLiveProductionAppStore];
27 - NSLog(@"%@",TIM_GetTokenUrl);  
28 - NSLog(@"%d",TestEnvironment);  
29 - NSLog(@"%@",AppId); 26 + NSLog(@"%@",EnvironmentDesc);
  27 + NSLog(@"%@",DisplayName);
30 28
31 - NSLog(@"%@",AppDownloadUrl);  
32 29
33 } 30 }
34 31