初始化配置接口的请求
This commit is contained in:
@@ -283,6 +283,7 @@
|
||||
E8C6FFEA2755040B004DC9F0 /* XPHomeSearchNavView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8C6FFE92755040B004DC9F0 /* XPHomeSearchNavView.m */; };
|
||||
E8C6FFED27550CC2004DC9F0 /* HomeSearchResultModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8C6FFEC27550CC2004DC9F0 /* HomeSearchResultModel.m */; };
|
||||
E8CEA03D26EA3DE500644B44 /* LoginPasswordPresent.m in Sources */ = {isa = PBXBuildFile; fileRef = E8CEA03C26EA3DE500644B44 /* LoginPasswordPresent.m */; };
|
||||
E8DEC99527648FA50078CB70 /* ClientConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = E8DEC99427648FA50078CB70 /* ClientConfig.m */; };
|
||||
E8E70D7726F2F15100F03460 /* XPMineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E70D7626F2F15100F03460 /* XPMineViewController.m */; };
|
||||
E8E70D7A26F2F16600F03460 /* XPMinePresent.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E70D7926F2F16600F03460 /* XPMinePresent.m */; };
|
||||
E8E70D7E26F2F19D00F03460 /* Api+Mine.m in Sources */ = {isa = PBXBuildFile; fileRef = E8E70D7D26F2F19D00F03460 /* Api+Mine.m */; };
|
||||
@@ -862,6 +863,8 @@
|
||||
E8CEA03B26EA3DE500644B44 /* LoginPasswordPresent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginPasswordPresent.h; sourceTree = "<group>"; };
|
||||
E8CEA03C26EA3DE500644B44 /* LoginPasswordPresent.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginPasswordPresent.m; sourceTree = "<group>"; };
|
||||
E8CEA03E26EA3E0200644B44 /* LoginPasswordProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginPasswordProtocol.h; sourceTree = "<group>"; };
|
||||
E8DEC99327648FA50078CB70 /* ClientConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ClientConfig.h; sourceTree = "<group>"; };
|
||||
E8DEC99427648FA50078CB70 /* ClientConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ClientConfig.m; sourceTree = "<group>"; };
|
||||
E8E70D7526F2F15100F03460 /* XPMineViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineViewController.h; sourceTree = "<group>"; };
|
||||
E8E70D7626F2F15100F03460 /* XPMineViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineViewController.m; sourceTree = "<group>"; };
|
||||
E8E70D7826F2F16600F03460 /* XPMinePresent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMinePresent.h; sourceTree = "<group>"; };
|
||||
@@ -1444,6 +1447,8 @@
|
||||
18E7B1AE26E8AD760064BC9B /* MainProtocol.h */,
|
||||
189DD53226DE255300AB55B1 /* TabbarViewController.h */,
|
||||
189DD53326DE255300AB55B1 /* TabbarViewController.m */,
|
||||
E8DEC99327648FA50078CB70 /* ClientConfig.h */,
|
||||
E8DEC99427648FA50078CB70 /* ClientConfig.m */,
|
||||
);
|
||||
path = Tabbar;
|
||||
sourceTree = "<group>";
|
||||
@@ -2906,6 +2911,7 @@
|
||||
E8AC721C26F4720B007D6E91 /* XPMineSettingPresent.m in Sources */,
|
||||
E88B5CA526FB088600DA9178 /* XPMineTeenagerViewController.m in Sources */,
|
||||
E8AEAEF027141C430017FCE0 /* XPRoomMenuContainerView.m in Sources */,
|
||||
E8DEC99527648FA50078CB70 /* ClientConfig.m in Sources */,
|
||||
E8EEB90926FC579A007C6EBA /* XPMineUserInfoEditTableViewCell.m in Sources */,
|
||||
18C17A5D26F338F300C48E11 /* XplanFBFlutterViewContainer.m in Sources */,
|
||||
E89DA67527009ACD008483C1 /* XPMineRechargeNavView.m in Sources */,
|
||||
|
@@ -16,6 +16,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// 巨量广告回调 参数中有一个id 是系统的关键字 不知道怎么使用上面的那种方法构建参数
|
||||
+ (void)appInitObserverJuliangAd:(HttpRequestHelperCompletion)complection;
|
||||
|
||||
/// 初始化配置
|
||||
/// @param complection 完成
|
||||
+ (void)clientInitConfig:(HttpRequestHelperCompletion)complection;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -44,5 +44,11 @@
|
||||
[HttpRequestHelper request:@"juliang/ad/activeTrack" method:HttpRequestHelperMethodPOST params:params completion:complection];
|
||||
}
|
||||
|
||||
/// 初始化配置
|
||||
/// @param complection 完成
|
||||
+ (void)clientInitConfig:(HttpRequestHelperCompletion)complection {
|
||||
[self makeRequest:@"client/init" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, nil];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
22
xplan-ios/Main/Tabbar/ClientConfig.h
Normal file
22
xplan-ios/Main/Tabbar/ClientConfig.h
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// ClientConfig.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/12/11.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ClientConfig : NSObject
|
||||
+ (instancetype)shareConfig;
|
||||
///初始化
|
||||
- (void)clientInit;
|
||||
/// 是否开启了糖果树
|
||||
@property (nonatomic,assign) BOOL openCandyTree;
|
||||
///开箱子 大于等级 展示
|
||||
@property (nonatomic, assign) NSInteger openCandyTreeLimitLevel;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
45
xplan-ios/Main/Tabbar/ClientConfig.m
Normal file
45
xplan-ios/Main/Tabbar/ClientConfig.m
Normal file
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// ClientConfig.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2021/12/11.
|
||||
//
|
||||
|
||||
#import "ClientConfig.h"
|
||||
#import "Api+Main.h"
|
||||
|
||||
@interface ClientConfig ()
|
||||
///重试的次数 10次 如果你还是失败的话 那就算了 没办法了
|
||||
@property (nonatomic,assign) int retryCount;
|
||||
@end
|
||||
|
||||
@implementation ClientConfig
|
||||
|
||||
+ (instancetype)shareConfig {
|
||||
static dispatch_once_t onceToken;
|
||||
static ClientConfig * config;
|
||||
dispatch_once(&onceToken, ^{
|
||||
config = [[ClientConfig alloc] init];
|
||||
});
|
||||
return config;
|
||||
}
|
||||
|
||||
- (void)clientInit {
|
||||
[Api clientInitConfig:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
self.retryCount = 0;
|
||||
NSDictionary * initData = data.data;
|
||||
//糖果树配置
|
||||
self.openCandyTree = [initData[@"openBoxSwitch"] boolValue];
|
||||
self.openCandyTreeLimitLevel = [initData[@"openBoxSwitchLevelNo"] intValue];
|
||||
} else {
|
||||
if (self.retryCount < 10) {
|
||||
[self clientInit];
|
||||
self.retryCount+=1;
|
||||
}
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
@end
|
@@ -75,4 +75,5 @@
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#import "TTPopup.h"
|
||||
#import "XPConstant.h"
|
||||
#import "XPRoomMiniManager.h"
|
||||
#import "ClientConfig.h"
|
||||
///Model
|
||||
#import "AccountModel.h"
|
||||
#import "RoomInfoModel.h"
|
||||
@@ -53,11 +54,9 @@
|
||||
[super viewDidLoad];
|
||||
[self configTheme];
|
||||
[self initTabs:NO];
|
||||
|
||||
[[ClientConfig shareConfig] clientInit];
|
||||
[[NIMSDK sharedSDK].loginManager addDelegate:self];
|
||||
[self.presenter juliandAdCallBackApi];
|
||||
|
||||
|
||||
[self.view addSubview:self.roomMineView];
|
||||
[[NSNotificationCenter defaultCenter] addObserverForName:kRoomMiniNotificationKey object:nil queue:nil usingBlock:^(NSNotification * _Nonnull note) {
|
||||
[self configRoomMiniNView:note.userInfo];
|
||||
|
Reference in New Issue
Block a user