hch
2024-04-03 20616d1f01f49812d72fabfa2a3fc16bbf825d7f
0312 港台国内quick 和 越南 sdk初始化通知在热更加载后
2个文件已修改
52 ■■■■ 已修改文件
Channel/IOS/hyyngame/Plugins/The2thWorldSDK/UniversalSDK.mm 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Channel/IOS/mlgtgame_quick/Plugins/The2thWorldSDK/UniversalSDK.mm 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Channel/IOS/hyyngame/Plugins/The2thWorldSDK/UniversalSDK.mm
@@ -218,10 +218,6 @@
    
    [[MoHuanSDK sharedGameSDK] application:application
                  didFinishLaunchingWithOptions:launchOptions];
    NSMutableDictionary *_dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                  [NSNumber numberWithInt:S2U_SdkInitComplete], @"code",
                                  @"hyyn", @"channelPlatform", nil];
    [self SendMessageToUnity:_dict];
    
}
@@ -232,6 +228,11 @@
    NSLog(@"\n***************初始化成功****************");
    NSDictionary *_dict = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:S2U_FreePlatformInitOk], @"code", nil];
    [self SendMessageToUnity:_dict];
    NSMutableDictionary *_dict1 = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                  [NSNumber numberWithInt:S2U_SdkInitComplete], @"code",
                                  @"hyyn", @"channelPlatform", nil];
    [self SendMessageToUnity:_dict1];
}
- (void)onInitFail:(NSError *)kerror
{
Channel/IOS/mlgtgame_quick/Plugins/The2thWorldSDK/UniversalSDK.mm
@@ -29,6 +29,10 @@
static NSString* sUserName;
static NSThread* _thread;
static NSString* channel;
static bool isOPSdkInitOK = false; //渠道sdk是否初始化成功
static bool isGameInitOK = false; //游戏的代码模块是否加载,sdk在热更部分,未加载会导致初始化失败
-(id)init
{
@@ -46,6 +50,12 @@
-(void) Init
{
    isGameInitOK = true;
    if (isOPSdkInitOK)
    {
        [self SendToGameSdkInitOK];
    }
    UIDevice *_device = [UIDevice currentDevice];
    _device.batteryMonitoringEnabled = true;
    
@@ -219,19 +229,10 @@
    // ------------------------------------------------------
}
- (void)smpcQpInitResult:(NSNotification *)notify {
    NSLog(@"init result:%@",notify);
    NSDictionary *userInfo = notify.userInfo;
    int errorCode = [userInfo[kSmpcQuickSDKKeyError] intValue];
    switch (errorCode) {
        case SMPC_QUICK_SDK_ERROR_NONE:
- (void) SendToGameSdkInitOK
        {
            NSLog(@"初始化成功");
//            NSString *_appid = [[SMPCQuickSDK defaultInstance] getConfigValue:@"zfappid"];
//            if (_appid == nil || [_appid isEqualToString:@""])
//            {
//                _appid = sAppID;
//            }
            NSString *_appid = sAppID;
            NSLog(@"init _appid:%@",_appid);
            
@@ -241,6 +242,26 @@
                                          _appid, @"yj_appid", _appid, @"yj_spid", nil];
            [self SendMessageToUnity:_dict];
        }
- (void)smpcQpInitResult:(NSNotification *)notify {
    NSLog(@"init result:%@",notify);
    NSDictionary *userInfo = notify.userInfo;
    int errorCode = [userInfo[kSmpcQuickSDKKeyError] intValue];
    switch (errorCode) {
        case SMPC_QUICK_SDK_ERROR_NONE:
        {
            isOPSdkInitOK = true;
            if (isGameInitOK)
            {
                [self SendToGameSdkInitOK];
            }
            else
            {
                NSLog(@"渠道sdk初始化成功,等待游戏加载后通知");
            }
        }
            break;
        case SMPC_QUICK_SDK_ERROR_INIT_FAILED:
        default: