allez
2022-06-29 913770aa650099bb7c1c3df1d4f89e1fa93b7775
Channel/IOS/sohagame/Plugins/The2thWorldSDK/UniversalSDK.mm
@@ -31,7 +31,8 @@
static NSString* sUserName;
static NSThread* _thread;
static int initedState=0; //初始化状态,0初始化中,1成功,2未登录(因为ios在sdk登录成功 游戏还没初始化好无法处理逻辑,所以不能在1处理登录)
//初始化状态,0初始化中,1成功
static int initedState=0;
static NSString * const kClientID = @"468442318367-ocoqrm0kei0gpkrnnq1ql628v4g4dbqd.apps.googleusercontent.com";
@@ -213,7 +214,7 @@
    [Soha sohaInitWithGameDelegate:self
                          application:[UIApplication sharedApplication]
                        launchOptions:launchOptions
                        loginManually:NO
                        loginManually:YES
                     andSetLanguageTo:SohaSDKLanguageVietnam];
    [Soha showInAppPopupTracking];
@@ -242,7 +243,6 @@
        NSMutableDictionary *_dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                      [NSNumber numberWithInt:S2U_DelAccount], @"code", nil];
        [self SendMessageToUnity:_dict];
        initedState=2;
    }
}
@@ -272,7 +272,6 @@
    else
    {
        NSLog(@"渠道登录失败");
        initedState=2;
    }
}
@@ -280,7 +279,6 @@
    NSLog(@"渠道注销成功");
    NSDictionary *_dict = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:S2U_FreePlatformLogoutOk], @"code", nil];
    [self SendMessageToUnity:_dict];
    initedState=2;
}
- (void)sohaDidPurchaseFailed:(SohaTransaction *)transaction purchaseError:(NSString *)error {
@@ -321,10 +319,9 @@
        case 0:
            break;
        case 1:
            [Soha sohaLoginSDK];
            break;
        case 2:
            //ios特殊处理,sdk初始化比游戏快,导致游戏的sdk初始化值为false 需要在未登录处理
            [Soha sohaLoginSDK];
            break;
        default:
            break;