优化 NIMSDK 和 SudSDK 的初始化逻辑,新增从配置中获取 appKey 和 appId 的功能,提升代码灵活性和可维护性。同时,修正 sudKey 的属性名称以保持一致性。
This commit is contained in:
@@ -99,7 +99,11 @@ UIKIT_EXTERN NSString * adImageName;
|
|||||||
}
|
}
|
||||||
- (void)configNIMSDK {
|
- (void)configNIMSDK {
|
||||||
//推荐在程序启动的时候初始化 NIMSDK
|
//推荐在程序启动的时候初始化 NIMSDK
|
||||||
NSString *appKey = KeyWithType(KeyType_NetEase);
|
NSString *appKey = [[ClientConfig shareConfig].configInfo nimKey];
|
||||||
|
if ([NSString isEmpty:appKey]) {
|
||||||
|
appKey = KeyWithType(KeyType_NetEase);
|
||||||
|
}
|
||||||
|
|
||||||
NIMSDKOption *option = [NIMSDKOption optionWithAppKey:appKey];
|
NIMSDKOption *option = [NIMSDKOption optionWithAppKey:appKey];
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
option.apnsCername = @"pikoDevelopPush";
|
option.apnsCername = @"pikoDevelopPush";
|
||||||
|
@@ -109,7 +109,7 @@ typedef NS_ENUM(NSInteger, FaceLivenessStrategy) {
|
|||||||
@property(nonatomic, assign) BOOL captchaSwitch;
|
@property(nonatomic, assign) BOOL captchaSwitch;
|
||||||
|
|
||||||
@property (nonatomic, copy) NSString *sudId;
|
@property (nonatomic, copy) NSString *sudId;
|
||||||
@property (nonatomic, copy) NSString *sudKey;
|
@property (nonatomic, copy) NSString *sudkey;
|
||||||
@property (nonatomic, copy) NSString *nimKey;
|
@property (nonatomic, copy) NSString *nimKey;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
#import "Api+LittleGame.h"
|
#import "Api+LittleGame.h"
|
||||||
#import "AccountInfoStorage.h"
|
#import "AccountInfoStorage.h"
|
||||||
|
|
||||||
|
#import "ClientConfig.h"
|
||||||
|
|
||||||
#import "SudCommon.h"
|
#import "SudCommon.h"
|
||||||
#import "SudGameConfig.h"
|
#import "SudGameConfig.h"
|
||||||
@@ -110,7 +110,15 @@
|
|||||||
#else
|
#else
|
||||||
isTestEnv = NO;
|
isTestEnv = NO;
|
||||||
#endif
|
#endif
|
||||||
[SudMGP initSDK:KeyWithType(KeyType_SudGameAppID) appKey:KeyWithType(KeyType_SudGameAppKey) isTestEnv:isTestEnv listener:^(int retCode, const NSString *retMsg) {
|
NSString *SUDAPPID = [[ClientConfig shareConfig].configInfo sudId];
|
||||||
|
NSString *SUDAPPKEY = [[ClientConfig shareConfig].configInfo sudkey];
|
||||||
|
if ([NSString isEmpty:SUDAPPID]) {
|
||||||
|
SUDAPPID = KeyWithType(KeyType_SudGameAppID);
|
||||||
|
}
|
||||||
|
if ([NSString isEmpty:SUDAPPKEY]) {
|
||||||
|
SUDAPPKEY = KeyWithType(KeyType_SudGameAppKey);
|
||||||
|
}
|
||||||
|
[SudMGP initSDK:SUDAPPID appKey:SUDAPPKEY isTestEnv:isTestEnv listener:^(int retCode, const NSString *retMsg) {
|
||||||
if (retCode == 0) {
|
if (retCode == 0) {
|
||||||
if (!self.currentmgId) {
|
if (!self.currentmgId) {
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user