From 76ec67c932695b85e47b2836946c5ddc47d9afb2 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期二, 29 十月 2024 20:45:59 +0800
Subject: [PATCH] 0312 初始化可以提前,但是通知给unity延后到launch启动

---
 Channel/IOS/tqxbqy/Plugins/The2thWorldSDK/UniversalSDK.mm |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/Channel/IOS/tqxbqy/Plugins/The2thWorldSDK/UniversalSDK.mm b/Channel/IOS/tqxbqy/Plugins/The2thWorldSDK/UniversalSDK.mm
index 7106ada..c0b3023 100644
--- a/Channel/IOS/tqxbqy/Plugins/The2thWorldSDK/UniversalSDK.mm
+++ b/Channel/IOS/tqxbqy/Plugins/The2thWorldSDK/UniversalSDK.mm
@@ -46,13 +46,6 @@
 
 -(void) Init
 {
-	// --------------------- 鍒濆鍖� --------------------------
-    SMPCQuickSDKInitConfigure *cfg = [[SMPCQuickSDKInitConfigure alloc] init];
-    cfg.productKey = PRODUCT_KEY;
-    cfg.productCode = PRODUCT_CODE;
-    [[SMPCQuickSDK defaultInstance] initWithConfig:cfg application:application didFinishLaunchingWithOptions:launchOptions];
-    // ------------------------------------------------------
-	
     UIDevice *_device = [UIDevice currentDevice];
     _device.batteryMonitoringEnabled = true;
     
@@ -91,6 +84,15 @@
                                       _userAgent,@"userAgent",nil];
         [self SendMessageToUnity:_dict];
         }];
+		
+	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)SendMessageToUnity:(NSDictionary*)dict
@@ -218,7 +220,12 @@
     // 鐩戝惉鍏呭�肩粨鏋�
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(smpcQpRechargeResult:) name:kSmpcQuickSDKNotiRecharge object:nil];
     
-
+    // --------------------- 鍒濆鍖� --------------------------
+    SMPCQuickSDKInitConfigure *cfg = [[SMPCQuickSDKInitConfigure alloc] init];
+    cfg.productKey = PRODUCT_KEY;
+    cfg.productCode = PRODUCT_CODE;
+    [[SMPCQuickSDK defaultInstance] initWithConfig:cfg application:application didFinishLaunchingWithOptions:launchOptions];
+    // ------------------------------------------------------
 }
 
 - (void)smpcQpInitResult:(NSNotification *)notify {
@@ -234,14 +241,7 @@
 //            {
 //                _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];
+
         }
             break;
         case SMPC_QUICK_SDK_ERROR_INIT_FAILED:

--
Gitblit v1.8.0