Commit 48d938a487119a7c10b48e93bbdb8160a3bbffe9

Authored by niudaojian
1 parent 66ebd1ac

判断是否是新版本首页

CNLiveEnvironment.podspec
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 8
9 Pod::Spec.new do |s| 9 Pod::Spec.new do |s|
10 s.name = 'CNLiveEnvironment' 10 s.name = 'CNLiveEnvironment'
11 - s.version = '0.4.4' 11 + s.version = '0.4.5'
12 s.summary = 'CNLiveEnvironment' 12 s.summary = 'CNLiveEnvironment'
13 13
14 # This description is used to generate tags and improve search results. 14 # This description is used to generate tags and improve search results.
CNLiveEnvironment/Classes/CNLiveEnvironment.h
@@ -23,6 +23,9 @@ @@ -23,6 +23,9 @@
23 // 是否是测试环境 23 // 是否是测试环境
24 #define TestEnvironment [CNLiveEnvironmentManager manager].isTestEnvironment 24 #define TestEnvironment [CNLiveEnvironmentManager manager].isTestEnvironment
25 25
  26 +// 是否是新版首页
  27 +#define NewHomePage [CNLiveEnvironmentManager manager].isNewHomePage
  28 +
26 // 下载Url 29 // 下载Url
27 /** 正式@"http://apiwjj.cnlive.com/download/index.html" 30 /** 正式@"http://apiwjj.cnlive.com/download/index.html"
28 测试@"http://apiwjj.cnlive.com/download/index.html"*/ 31 测试@"http://apiwjj.cnlive.com/download/index.html"*/
CNLiveEnvironment/Classes/CNLiveEnvironmentManager.h
@@ -30,6 +30,9 @@ typedef NS_ENUM(NSInteger, CNLiveAppType) { @@ -30,6 +30,9 @@ typedef NS_ENUM(NSInteger, CNLiveAppType) {
30 @property (nonatomic, assign, readonly) CNLiveEnvironmentType environmentType; // 详细环境 30 @property (nonatomic, assign, readonly) CNLiveEnvironmentType environmentType; // 详细环境
31 @property (nonatomic, assign, readonly) BOOL isTestEnvironment; // 是否是测试环境 31 @property (nonatomic, assign, readonly) BOOL isTestEnvironment; // 是否是测试环境
32 32
  33 +/// 是否是新版首页
  34 +@property (nonatomic, assign, readonly) BOOL isNewHomePage;
  35 +
33 @property (nonatomic, copy, readonly) NSString *kAppDownloadUrl;// 下载地址 36 @property (nonatomic, copy, readonly) NSString *kAppDownloadUrl;// 下载地址
34 @property (nonatomic, copy, readonly) NSString *kWjjH5_Host; 37 @property (nonatomic, copy, readonly) NSString *kWjjH5_Host;
35 @property (nonatomic, copy, readonly) NSString *kWjjH5_Host_Https; 38 @property (nonatomic, copy, readonly) NSString *kWjjH5_Host_Https;
@@ -146,6 +149,16 @@ typedef NS_ENUM(NSInteger, CNLiveAppType) { @@ -146,6 +149,16 @@ typedef NS_ENUM(NSInteger, CNLiveAppType) {
146 + (void)setEnvironment:(CNLiveEnvironmentType)environmentType; 149 + (void)setEnvironment:(CNLiveEnvironmentType)environmentType;
147 150
148 /** 151 /**
  152 + * @abstract 初始化用户端配置
  153 + * @param environmentType 环境
  154 + * @param isNewHomePage 是否是新版首页
  155 + * @warning 必传参数
  156 + * 在默认DEBUG环境下为测试商店版,建议使用如下方法初始化.
  157 + * 在 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; 方法中调用
  158 + */
  159 ++ (void)setEnvironment:(CNLiveEnvironmentType)environmentType isNewHomePage:(BOOL)isNewHomePage;
  160 +
  161 +/**
149 * @abstract 初始化企业端直播配置 162 * @abstract 初始化企业端直播配置
150 * @param environmentType 环境 163 * @param environmentType 环境
151 * @warning 必传参数 164 * @warning 必传参数
CNLiveEnvironment/Classes/CNLiveEnvironmentManager.m
@@ -14,6 +14,9 @@ @@ -14,6 +14,9 @@
14 @property (nonatomic, assign, readwrite) CNLiveEnvironmentType environmentType; //详细环境 14 @property (nonatomic, assign, readwrite) CNLiveEnvironmentType environmentType; //详细环境
15 @property (nonatomic, assign, readwrite) BOOL isTestEnvironment; // 是否是测试环境 15 @property (nonatomic, assign, readwrite) BOOL isTestEnvironment; // 是否是测试环境
16 16
  17 +/// 是否是新版首页
  18 +@property (nonatomic, assign, readwrite) BOOL isNewHomePage;
  19 +
17 @property (nonatomic, copy, readwrite) NSString *kAppDownloadUrl; 20 @property (nonatomic, copy, readwrite) NSString *kAppDownloadUrl;
18 @property (nonatomic, copy, readwrite) NSString *kWjjH5_Host; 21 @property (nonatomic, copy, readwrite) NSString *kWjjH5_Host;
19 @property (nonatomic, copy, readwrite) NSString *kWjjH5_Host_Https; 22 @property (nonatomic, copy, readwrite) NSString *kWjjH5_Host_Https;
@@ -173,8 +176,15 @@ static CNLiveEnvironmentManager *_instance = nil; @@ -173,8 +176,15 @@ static CNLiveEnvironmentManager *_instance = nil;
173 * 在 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; 方法中调用 176 * 在 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; 方法中调用
174 */ 177 */
175 + (void)setEnvironment:(CNLiveEnvironmentType)environmentType{ 178 + (void)setEnvironment:(CNLiveEnvironmentType)environmentType{
  179 + [self setEnvironment:environmentType isNewHomePage:NO];
  180 +}
  181 ++ (void)setEnvironment:(CNLiveEnvironmentType)environmentType isNewHomePage:(BOOL)isNewHomePage;
  182 +{
  183 +
176 CNLiveEnvironmentManager *manager = [CNLiveEnvironmentManager manager]; 184 CNLiveEnvironmentManager *manager = [CNLiveEnvironmentManager manager];
177 manager.environmentType = environmentType; 185 manager.environmentType = environmentType;
  186 + manager.isNewHomePage = isNewHomePage;
  187 +
178 switch (environmentType) { 188 switch (environmentType) {
179 #pragma mark - 测试企业环境 189 #pragma mark - 测试企业环境
180 case CNLiveDebugInHouse://测试企业环境 190 case CNLiveDebugInHouse://测试企业环境
@@ -613,8 +623,6 @@ static CNLiveEnvironmentManager *_instance = nil; @@ -613,8 +623,6 @@ static CNLiveEnvironmentManager *_instance = nil;
613 623
614 } 624 }
615 625
616 -  
617 -  
618 #pragma mark - ******** 企业端直播 ******** 626 #pragma mark - ******** 企业端直播 ********
619 + (void)setBLiveEnvironment:(CNLiveEnvironmentType)environmentType{ 627 + (void)setBLiveEnvironment:(CNLiveEnvironmentType)environmentType{
620 CNLiveEnvironmentManager *manager = [CNLiveEnvironmentManager manager]; 628 CNLiveEnvironmentManager *manager = [CNLiveEnvironmentManager manager];