From 9d7fd12cf3c3eb1f5010290414db0e62f8cb3c64 Mon Sep 17 00:00:00 2001 From: huyufei Date: Wed, 22 May 2024 21:30:05 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"fix:=20=E6=9B=B4=E6=96=B0=20IAP=20?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E7=9A=84=E6=97=B6=E6=9C=BA"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 093e309e52e0f3d5646661276565b9d3a73490c0. --- Runtime/Code/SDK/GuruSDK.cs | 58 ++++++++++++------------------------- 1 file changed, 19 insertions(+), 39 deletions(-) diff --git a/Runtime/Code/SDK/GuruSDK.cs b/Runtime/Code/SDK/GuruSDK.cs index a141278..7e1f3e0 100644 --- a/Runtime/Code/SDK/GuruSDK.cs +++ b/Runtime/Code/SDK/GuruSDK.cs @@ -184,12 +184,6 @@ namespace Guru success = false; } Callbacks.SDK._onUserAuthResult?.Invoke(success); - - if (success && !IsIAPReady) - { - StartIapService(); - } - } private void OnFirebaseAuthResult(bool success) @@ -350,7 +344,24 @@ namespace Guru } //----------- Set IAP ---------------- - + if (useIAP) + { + // InitIAP(_initConfig.GoogleKeys, _initConfig.AppleRootCerts); // 初始化IAP + Try(() => + { + LogI($"#4.3 --- Start IAP ---"); + if (_initConfig.GoogleKeys == null || _initConfig.AppleRootCerts == null) + { + LogException("[IAP] GoogleKeys is null when using IAPService! Integration failed. App will Exit"); + } + + + InitIAP(UID, _initConfig.GoogleKeys, _initConfig.AppleRootCerts); // 初始化IAP + }, ex => + { + UnityEngine.Debug.LogError($"--- ERROR on useIAP: {ex.Message}"); + }); + } //----------- Set Keywords ---------------- if (useKeywords) { @@ -405,38 +416,7 @@ namespace Guru StartAndroidDebugCmds(); #endif } - - - - private void StartIapService() - { - LogI($"#4.3 --- Start IAP ---"); - if (_initConfig.IAPEnabled && _appServicesConfig.IsIAPEnabled()) - { - // InitIAP(_initConfig.GoogleKeys, _initConfig.AppleRootCerts); // 初始化IAP - Try(() => - { - if (_initConfig.GoogleKeys == null || _initConfig.AppleRootCerts == null) - { - LogException("[IAP] GoogleKeys is null when using IAPService! Integration failed. App will Exit"); - return; - } - - InitIAP(UID, _initConfig.GoogleKeys, _initConfig.AppleRootCerts); // 初始化IAP - }, ex => - { - UnityEngine.Debug.LogError($"--- ERROR on useIAP: {ex.Message}"); - }); - } - else - { - LogI($"--- IAP is not enabled, skip IAP service init :: _initConfig.IAPEnabled:{_initConfig.IAPEnabled} guruService.IsIAPEnabled:{_appServicesConfig.IsIAPEnabled()}"); - } - - } - - - + /// /// Get the guru-service cloud config value; /// User can fetch the cloud guru-service config by using Custom Service Key