From 20616d1f01f49812d72fabfa2a3fc16bbf825d7f Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期三, 03 四月 2024 12:26:27 +0800
Subject: [PATCH] 0312 港台国内quick 和 越南 sdk初始化通知在热更加载后
---
Channel/IOS/hyyngame/Plugins/The2thWorldSDK/UniversalSDK.mm | 9 +++++----
Channel/IOS/mlgtgame_quick/Plugins/The2thWorldSDK/UniversalSDK.mm | 49 +++++++++++++++++++++++++++++++++++--------------
2 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/Channel/IOS/hyyngame/Plugins/The2thWorldSDK/UniversalSDK.mm b/Channel/IOS/hyyngame/Plugins/The2thWorldSDK/UniversalSDK.mm
index 39aaa02..2755ffb 100644
--- a/Channel/IOS/hyyngame/Plugins/The2thWorldSDK/UniversalSDK.mm
+++ b/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
{
diff --git a/Channel/IOS/mlgtgame_quick/Plugins/The2thWorldSDK/UniversalSDK.mm b/Channel/IOS/mlgtgame_quick/Plugins/The2thWorldSDK/UniversalSDK.mm
index 6507195..ee687c3 100644
--- a/Channel/IOS/mlgtgame_quick/Plugins/The2thWorldSDK/UniversalSDK.mm
+++ b/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,6 +229,22 @@
// ------------------------------------------------------
}
+- (void) SendToGameSdkInitOK
+{
+ NSLog(@"鍒濆鍖栨垚鍔�");
+
+ NSString *_appid = sAppID;
+ NSLog(@"init _appid:%@",_appid);
+
+ NSMutableDictionary *_dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
+ [NSNumber numberWithInt:S2U_SdkInitComplete], @"code",
+ @"hygame", @"channelPlatform",
+ _appid, @"yj_appid", _appid, @"yj_spid", nil];
+ [self SendMessageToUnity:_dict];
+}
+
+
+
- (void)smpcQpInitResult:(NSNotification *)notify {
NSLog(@"init result:%@",notify);
NSDictionary *userInfo = notify.userInfo;
@@ -226,20 +252,15 @@
switch (errorCode) {
case SMPC_QUICK_SDK_ERROR_NONE:
{
- NSLog(@"鍒濆鍖栨垚鍔�");
-// NSString *_appid = [[SMPCQuickSDK defaultInstance] getConfigValue:@"zfappid"];
-// if (_appid == nil || [_appid isEqualToString:@""])
-// {
-// _appid = sAppID;
-// }
- NSString *_appid = sAppID;
- NSLog(@"init _appid:%@",_appid);
-
- NSMutableDictionary *_dict = [NSMutableDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithInt:S2U_SdkInitComplete], @"code",
- @"hygame", @"channelPlatform",
- _appid, @"yj_appid", _appid, @"yj_spid", nil];
- [self SendMessageToUnity:_dict];
+ isOPSdkInitOK = true;
+ if (isGameInitOK)
+ {
+ [self SendToGameSdkInitOK];
+ }
+ else
+ {
+ NSLog(@"娓犻亾sdk鍒濆鍖栨垚鍔燂紝绛夊緟娓告垙鍔犺浇鍚庨�氱煡");
+ }
}
break;
case SMPC_QUICK_SDK_ERROR_INIT_FAILED:
--
Gitblit v1.8.0