Commit 48d938a487119a7c10b48e93bbdb8160a3bbffe9
1 parent
66ebd1ac
判断是否是新版本首页
Showing
4 changed files
with
27 additions
and
3 deletions
CNLiveEnvironment.podspec
CNLiveEnvironment/Classes/CNLiveEnvironment.h
| ... | ... | @@ -23,6 +23,9 @@ |
| 23 | 23 | // 是否是测试环境 |
| 24 | 24 | #define TestEnvironment [CNLiveEnvironmentManager manager].isTestEnvironment |
| 25 | 25 | |
| 26 | +// 是否是新版首页 | |
| 27 | +#define NewHomePage [CNLiveEnvironmentManager manager].isNewHomePage | |
| 28 | + | |
| 26 | 29 | // 下载Url |
| 27 | 30 | /** 正式@"http://apiwjj.cnlive.com/download/index.html" |
| 28 | 31 | 测试@"http://apiwjj.cnlive.com/download/index.html"*/ | ... | ... |
CNLiveEnvironment/Classes/CNLiveEnvironmentManager.h
| ... | ... | @@ -30,6 +30,9 @@ typedef NS_ENUM(NSInteger, CNLiveAppType) { |
| 30 | 30 | @property (nonatomic, assign, readonly) CNLiveEnvironmentType environmentType; // 详细环境 |
| 31 | 31 | @property (nonatomic, assign, readonly) BOOL isTestEnvironment; // 是否是测试环境 |
| 32 | 32 | |
| 33 | +/// 是否是新版首页 | |
| 34 | +@property (nonatomic, assign, readonly) BOOL isNewHomePage; | |
| 35 | + | |
| 33 | 36 | @property (nonatomic, copy, readonly) NSString *kAppDownloadUrl;// 下载地址 |
| 34 | 37 | @property (nonatomic, copy, readonly) NSString *kWjjH5_Host; |
| 35 | 38 | @property (nonatomic, copy, readonly) NSString *kWjjH5_Host_Https; |
| ... | ... | @@ -146,6 +149,16 @@ typedef NS_ENUM(NSInteger, CNLiveAppType) { |
| 146 | 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 | 162 | * @abstract 初始化企业端直播配置 |
| 150 | 163 | * @param environmentType 环境 |
| 151 | 164 | * @warning 必传参数 | ... | ... |
CNLiveEnvironment/Classes/CNLiveEnvironmentManager.m
| ... | ... | @@ -14,6 +14,9 @@ |
| 14 | 14 | @property (nonatomic, assign, readwrite) CNLiveEnvironmentType environmentType; //详细环境 |
| 15 | 15 | @property (nonatomic, assign, readwrite) BOOL isTestEnvironment; // 是否是测试环境 |
| 16 | 16 | |
| 17 | +/// 是否是新版首页 | |
| 18 | +@property (nonatomic, assign, readwrite) BOOL isNewHomePage; | |
| 19 | + | |
| 17 | 20 | @property (nonatomic, copy, readwrite) NSString *kAppDownloadUrl; |
| 18 | 21 | @property (nonatomic, copy, readwrite) NSString *kWjjH5_Host; |
| 19 | 22 | @property (nonatomic, copy, readwrite) NSString *kWjjH5_Host_Https; |
| ... | ... | @@ -173,8 +176,15 @@ static CNLiveEnvironmentManager *_instance = nil; |
| 173 | 176 | * 在 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; 方法中调用 |
| 174 | 177 | */ |
| 175 | 178 | + (void)setEnvironment:(CNLiveEnvironmentType)environmentType{ |
| 179 | + [self setEnvironment:environmentType isNewHomePage:NO]; | |
| 180 | +} | |
| 181 | ++ (void)setEnvironment:(CNLiveEnvironmentType)environmentType isNewHomePage:(BOOL)isNewHomePage; | |
| 182 | +{ | |
| 183 | + | |
| 176 | 184 | CNLiveEnvironmentManager *manager = [CNLiveEnvironmentManager manager]; |
| 177 | 185 | manager.environmentType = environmentType; |
| 186 | + manager.isNewHomePage = isNewHomePage; | |
| 187 | + | |
| 178 | 188 | switch (environmentType) { |
| 179 | 189 | #pragma mark - 测试企业环境 |
| 180 | 190 | case CNLiveDebugInHouse://测试企业环境 |
| ... | ... | @@ -613,8 +623,6 @@ static CNLiveEnvironmentManager *_instance = nil; |
| 613 | 623 | |
| 614 | 624 | } |
| 615 | 625 | |
| 616 | - | |
| 617 | - | |
| 618 | 626 | #pragma mark - ******** 企业端直播 ******** |
| 619 | 627 | + (void)setBLiveEnvironment:(CNLiveEnvironmentType)environmentType{ |
| 620 | 628 | CNLiveEnvironmentManager *manager = [CNLiveEnvironmentManager manager]; | ... | ... |