diff --git a/Assets/AddressableAssetsData/Android/addressables_content_state.bin b/Assets/AddressableAssetsData/Android/addressables_content_state.bin index dd98780..e895ba7 100644 Binary files a/Assets/AddressableAssetsData/Android/addressables_content_state.bin and b/Assets/AddressableAssetsData/Android/addressables_content_state.bin differ diff --git a/Assets/Editor/AutoBuild.cs b/Assets/Editor/AutoBuild.cs index c9853d2..7622952 100644 --- a/Assets/Editor/AutoBuild.cs +++ b/Assets/Editor/AutoBuild.cs @@ -51,7 +51,7 @@ public static class AutoBuild [MenuItem("AutoBuild/EmptySymbol")] static void EmptySymbol() { - PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android, ""); + PlayerSettings.SetScriptingDefineSymbols(UnityEditor.Build.NamedBuildTarget.Android, ""); } [MenuItem("AutoBuild/Set_AndroidKeyStore")] static void Set_AndroidKeyStore() @@ -73,13 +73,24 @@ public static class AutoBuild BuildStart("AndroidData/GoStop_Test_" + Application.version + "_(" + PlayerSettings.Android.bundleVersionCode + ").apk", BuildTarget.Android); PlayerSettings.bundleVersion = curVer; } + [MenuItem("AutoBuild/Build OneStore APK")] + static void Build_APK_OneStore() + { + Common(BuildTargetGroup.Android, BuildTarget.Android); + //PlayerSettings.Android.minSdkVersion = AndroidSdkVersions.AndroidApiLevel23; + + PlayerSettings.SetScriptingDefineSymbols(UnityEditor.Build.NamedBuildTarget.Android, "OneStore"); + EditorUserBuildSettings.buildAppBundle = false; + BuildStart("AndroidData/GoStop_Test_" + Application.version + "_(" + PlayerSettings.Android.bundleVersionCode + ").apk", BuildTarget.Android); + EmptySymbol(); + } [MenuItem("AutoBuild/Build Live AAB")] static void Build_AAB() { ++PlayerSettings.Android.bundleVersionCode; Common(BuildTargetGroup.Android, BuildTarget.Android); - PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android, "FGB_LIVE"); + PlayerSettings.SetScriptingDefineSymbols(UnityEditor.Build.NamedBuildTarget.Android, ""); EditorUserBuildSettings.buildAppBundle = true; BuildStart("AndroidData/GoStop_Live_" + Application.version + "_(" + PlayerSettings.Android.bundleVersionCode + ").aab", BuildTarget.Android); EmptySymbol(); diff --git a/Assets/GoogleMobileAds/link.xml.meta b/Assets/GoogleMobileAds/link.xml.meta index fb460b1..e74a03b 100644 --- a/Assets/GoogleMobileAds/link.xml.meta +++ b/Assets/GoogleMobileAds/link.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7ab68dd3fa82e4b4eb8e4795d6fbb273 +guid: f73007bb22bf455458373bb61c6817cb labels: - gvh - gvh_version-9.5.0 diff --git a/Assets/Keystore Helper.meta b/Assets/Keystore Helper.meta deleted file mode 100644 index 6674c7c..0000000 --- a/Assets/Keystore Helper.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f962e167eaa8d4a489e63d1db5839efd -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Keystore Helper/Editor.meta b/Assets/Keystore Helper/Editor.meta deleted file mode 100644 index eca09e8..0000000 --- a/Assets/Keystore Helper/Editor.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: e87bd305d2c974f279321dd6dbe03ec6 -folderAsset: yes -timeCreated: 1458317573 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Keystore Helper/Editor/AndroidKeystoreLoader.cs b/Assets/Keystore Helper/Editor/AndroidKeystoreLoader.cs deleted file mode 100644 index 3b6c3c7..0000000 --- a/Assets/Keystore Helper/Editor/AndroidKeystoreLoader.cs +++ /dev/null @@ -1,24 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System.IO; - -#if UNITY_EDITOR - -[InitializeOnLoad] -public class AndroidKeystoreLoader -{ - static AndroidKeystoreLoader() - { - string keystorePass, keyaliasName, keyaliasPass; - - keystorePass = KeystoreHelper.ReadPrefs(KeystoreHelper.KEYSTOREPASS); - keyaliasName = KeystoreHelper.ReadPrefs(KeystoreHelper.KEYALIASNAME); - keyaliasPass = KeystoreHelper.ReadPrefs(KeystoreHelper.KEYALIASPASS); - - PlayerSettings.Android.keystorePass = keystorePass; - PlayerSettings.Android.keyaliasName = keyaliasName; - PlayerSettings.Android.keyaliasPass = keyaliasPass; - } -} - -#endif \ No newline at end of file diff --git a/Assets/Keystore Helper/Editor/KeystoreHelper.cs b/Assets/Keystore Helper/Editor/KeystoreHelper.cs deleted file mode 100644 index 1d07f4b..0000000 --- a/Assets/Keystore Helper/Editor/KeystoreHelper.cs +++ /dev/null @@ -1,91 +0,0 @@ -using UnityEngine; -using UnityEditor; -using System.Collections; -using System; -using System.Text; -using System.Reflection; - -class KeystoreHelper : EditorWindow { - - public const string KEYSTOREPASS = "AKS_keystorePass_"; - public const string KEYALIASNAME = "AKS_keyaliasName_"; - public const string KEYALIASPASS = "AKS_keyaliasPass_"; - - private string keystorePass = ""; - private string keyaliasName = ""; - private string keyaliasPass = ""; - - [MenuItem ("Window/Keystore Helper")] - public static void ShowWindow () { - EditorWindow.GetWindow(typeof(KeystoreHelper)); - } - - void OnEnable() { - keystorePass = ReadPrefs(KEYSTOREPASS); - keyaliasName = ReadPrefs(KEYALIASNAME); - keyaliasPass = ReadPrefs(KEYALIASPASS); - - PlayerSettings.Android.keystorePass = keystorePass; - PlayerSettings.Android.keyaliasName = keyaliasName; - PlayerSettings.Android.keyaliasPass = keyaliasPass; - } - - void OnDisable() { - WritePrefs(KEYSTOREPASS, keystorePass); - WritePrefs(KEYALIASNAME, keyaliasName); - WritePrefs(KEYALIASPASS, keyaliasPass); - - PlayerSettings.Android.keystorePass = keystorePass; - PlayerSettings.Android.keyaliasName = keyaliasName; - PlayerSettings.Android.keyaliasPass = keyaliasPass; - } - - public static string ReadPrefs(string _key) { - string codeBase = Assembly.GetExecutingAssembly().CodeBase; - string key = _key+Md5Sum(codeBase); - return Decode(EditorPrefs.GetString(key, "")); - } - - public static void WritePrefs(string _key, string value) { - string codeBase = Assembly.GetExecutingAssembly().CodeBase; - string key = _key + Md5Sum(codeBase); - EditorPrefs.SetString(key, Encode(value)); - } - - void OnGUI () { - GUILayout.Label ("Android Keystore", EditorStyles.boldLabel); - keystorePass = EditorGUILayout.PasswordField ("Keystore Password", keystorePass); - keyaliasName = EditorGUILayout.TextField ("Key Alias Name", keyaliasName); - keyaliasPass = EditorGUILayout.PasswordField ("Key Alias Password", keyaliasPass); - } - - private static string Md5Sum(string strToEncrypt) - { - System.Text.UTF8Encoding ue = new System.Text.UTF8Encoding(); - byte[] bytes = ue.GetBytes(strToEncrypt); - - // encrypt bytes - System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider(); - byte[] hashBytes = md5.ComputeHash(bytes); - - // Convert the encrypted bytes back to a string (base 16) - string hashString = ""; - - for (int i = 0; i < hashBytes.Length; i++) - { - hashString += System.Convert.ToString(hashBytes[i], 16).PadLeft(2, '0'); - } - - return hashString.PadLeft(32, '0'); - } - - private static string Encode(string inputText) { - byte[] bytesToEncode = Encoding.UTF8.GetBytes (inputText); - return Convert.ToBase64String (bytesToEncode); - } - - private static string Decode(string encodedText) { - byte[] decodedBytes = Convert.FromBase64String (encodedText); - return Encoding.UTF8.GetString (decodedBytes); - } -} \ No newline at end of file diff --git a/Assets/Keystore Helper/README.pdf b/Assets/Keystore Helper/README.pdf deleted file mode 100644 index e023262..0000000 Binary files a/Assets/Keystore Helper/README.pdf and /dev/null differ diff --git a/Assets/Keystore Helper/README.pdf.meta b/Assets/Keystore Helper/README.pdf.meta deleted file mode 100644 index fd21817..0000000 --- a/Assets/Keystore Helper/README.pdf.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4a989aa6f253d4fba9884871e22997d1 -timeCreated: 1460876014 -licenseType: Store -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Memo.txt b/Assets/Memo.txt index 92bec1b..fb72cf1 100644 --- a/Assets/Memo.txt +++ b/Assets/Memo.txt @@ -28,6 +28,5 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// -데이터 저장, 불러오기 (구글 플레이센터로 변경) - 확인 필요 - -원스토어 검수 빌드 후 원스토어 결제 추가 \ No newline at end of file +원스토어 검수 빌드 후 원스토어 결제 추가 +한달에 70만원 초과 구매 체크 \ No newline at end of file diff --git a/Assets/OneStoreCorpPlugins.meta b/Assets/OneStoreCorpPlugins.meta index 9ed95e2..27c4124 100644 --- a/Assets/OneStoreCorpPlugins.meta +++ b/Assets/OneStoreCorpPlugins.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a38b4c520db724670b30b04da0be7c01 +guid: 204651c98036c4d3daa51358c1f71e07 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/AppLicenseChecker.meta b/Assets/OneStoreCorpPlugins/AppLicenseChecker.meta index e0a8551..db01bc3 100644 --- a/Assets/OneStoreCorpPlugins/AppLicenseChecker.meta +++ b/Assets/OneStoreCorpPlugins/AppLicenseChecker.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9b15d8887bf22409089afedfc3215b46 +guid: c912baa65aed04a0695d7deeb9e26f9f folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor.meta b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor.meta index fa12839..f964ef3 100644 --- a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor.meta +++ b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5e737082478de4f8cb850a38f00c2488 +guid: 45866b059e1ac4748ac1f5997e7563ac folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml index 07c1590..8820ced 100644 --- a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml +++ b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml @@ -1,8 +1,8 @@ - https://repo.onestore.co.kr/repository/onestore-sdk-public + https://repo.onestore.net/repository/onestore-sdk-public - + diff --git a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml.meta b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml.meta index ddc48ad..a3f5f16 100644 --- a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml.meta +++ b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 22835d64d81424a4a973b971bdf001f7 +guid: 3a871155c97ce4cb0befa3037f342edc TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Proguard.meta b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Proguard.meta index dac8e7c..96ef45d 100644 --- a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Proguard.meta +++ b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Proguard.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5368639f6f8b94a3fa108ae0442ac776 +guid: e8430a97b91bb4c4986ed7a70c40bfd3 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Proguard/alc-proguard.txt.meta b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Proguard/alc-proguard.txt.meta index 2cb0269..649d60a 100644 --- a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Proguard/alc-proguard.txt.meta +++ b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Proguard/alc-proguard.txt.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d25a6068257e1484a80f45db0abfa7a2 +guid: 5ca8f8998e0534e088a4771ae1fc1909 TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime.meta b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime.meta index 342cc62..a6429b3 100644 --- a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime.meta +++ b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b0be8215d7b2841d2ba7a2c0920485b1 +guid: 0c113be81d6ec415a800631bc1b1c9e2 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts.meta b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts.meta index 7edc8ce..5142ea2 100644 --- a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts.meta +++ b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 43b9607f255614a8d8bc960e200a6eaf +guid: 586e06c7044794af6b82b88f0dcf0b6b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/ILicenseCheckCallback.cs.meta b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/ILicenseCheckCallback.cs.meta index 1b88c95..d3a12a5 100644 --- a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/ILicenseCheckCallback.cs.meta +++ b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/ILicenseCheckCallback.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c0c7575908d62447bbbb66c6f846f505 +guid: 2812dfc9335dd4ca680f70b95551cf18 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal.meta b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal.meta index 8390447..2f6fa67 100644 --- a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal.meta +++ b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2272b91e6c0354de4af84ac36237d115 +guid: 51ff5605005df46c3aeaed3994057a54 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal/Constants.cs b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal/Constants.cs index 1eb9ce4..52c52b5 100644 --- a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal/Constants.cs +++ b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal/Constants.cs @@ -4,7 +4,7 @@ namespace OneStore.Alc.Internal { internal static class Constants { - public const string Version = "2.1.0"; + public const string Version = "2.2.1"; public static readonly TimeSpan AsyncTimeout = TimeSpan.FromMilliseconds(30000); public const string AppLicenseChecker = "com.onestore.extern.licensing.AppLicenseCheckerImpl"; diff --git a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal/Constants.cs.meta b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal/Constants.cs.meta index adef231..0875804 100644 --- a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal/Constants.cs.meta +++ b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal/Constants.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ad6e43bd6f5be4ade91f9331f2143270 +guid: 9b59d64b9c466404faf6ad9e76a2bd69 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal/LicenseCheckerListener.cs.meta b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal/LicenseCheckerListener.cs.meta index 7ef1821..b457a10 100644 --- a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal/LicenseCheckerListener.cs.meta +++ b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/Internal/LicenseCheckerListener.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c1dd2cc05dab6464e8438052ec61fb93 +guid: 6a637d767706346c2b6ccc07ce3dc9ca MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/OneStoreAppLicenseCheckerImpl.cs b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/OneStoreAppLicenseCheckerImpl.cs index 93419d7..23890e2 100644 --- a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/OneStoreAppLicenseCheckerImpl.cs +++ b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/OneStoreAppLicenseCheckerImpl.cs @@ -4,31 +4,38 @@ using System; using OneStore.Common; using OneStore.Alc.Internal; using UnityEngine; +using Logger = OneStore.Common.OneStoreLogger; namespace OneStore.Alc { public class OneStoreAppLicenseCheckerImpl { private AndroidJavaObject _appLicenseChecker; - private readonly OneStoreLogger _logger; - private readonly string _licenseKey; - private LicenseCheckerListener _listener; - private ILicenseCheckCallback _callback; - public OneStoreAppLicenseCheckerImpl(string licenseKey) { - if (Application.platform != RuntimePlatform.Android) { + /// + /// Initializes the ONE store App License Checker with the provided license key. + /// Ensures that the platform is Android before proceeding. + /// + /// The license key required for validation. + public OneStoreAppLicenseCheckerImpl(string licenseKey) + { + if (Application.platform != RuntimePlatform.Android) + { throw new PlatformNotSupportedException("Operation is not supported on this platform."); } - _logger = new OneStoreLogger(); _licenseKey = licenseKey; } - // ALC 연결 초기화 - public void Initialize(ILicenseCheckCallback callback) { + /// + /// Initializes the App License Checker (ALC) and establishes a connection. + /// + /// Callback interface for handling license check results. + public void Initialize(ILicenseCheckCallback callback) + { _callback = callback; _appLicenseChecker = new AndroidJavaObject(Constants.AppLicenseChecker, _licenseKey); @@ -38,6 +45,7 @@ namespace OneStore.Alc _listener.Denied += OnDenied; _listener.Error += OnError; + // Sets up the license checker with the Unity activity context and the listener. _appLicenseChecker.Call( Constants.AppLicenseCheckerSetupMethod, context, @@ -45,37 +53,63 @@ namespace OneStore.Alc ); } - // Cached API 호출 - // 캐시된 라이센스를 이용할 경우 사용한다. - public void QueryLicense() { - _logger.Log("do queryLicense"); + /// + /// Calls the Cached API to query the license. + /// Uses cached license information when available. + /// + public void QueryLicense() + { + Logger.Log("do queryLicense"); _appLicenseChecker.Call(Constants.AppLicenseCheckerQueryLicenseMethod); } - // Non-Cached API 호출 - // 캐시된 라이센스를 이용하지 않고 사용할 경우 사용한다. - public void StrictQueryLicense() { - _logger.Log("do strictQueryLicense"); + /// + /// Calls the Non-Cached API to query the license. + /// Does not use cached license information and forces a fresh validation. + /// + public void StrictQueryLicense() + { + Logger.Log("do strictQueryLicense"); _appLicenseChecker.Call(Constants.AppLicenseCheckerStrickQueryLicenseMethod); } - // ALC 연결 해제 - public void Destroy() { - _logger.Log("do destroy"); + /// + /// Disconnects and releases resources related to the App License Checker (ALC). + /// + public void Destroy() + { + Logger.Log("do destroy"); _appLicenseChecker.Call(Constants.AppLicenseCheckerDestroy); } - private void OnGranted(string license, string signature) { + + /// + /// Callback triggered when the license is successfully granted. + /// + /// The granted license key. + /// The license signature for verification. + private void OnGranted(string license, string signature) + { _callback.OnGranted(license, signature); } - private void OnDenied() { + /// + /// Callback triggered when the license validation is denied. + /// + private void OnDenied() + { _callback.OnDenied(); } - private void OnError(int code, string message) { + /// + /// Callback triggered when an error occurs during license validation. + /// + /// The error code returned. + /// A message describing the error. + private void OnError(int code, string message) + { _callback.OnError(code, message); } } - } -#endif + +#endif \ No newline at end of file diff --git a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/OneStoreAppLicenseCheckerImpl.cs.meta b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/OneStoreAppLicenseCheckerImpl.cs.meta index 59c3693..dbcb996 100644 --- a/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/OneStoreAppLicenseCheckerImpl.cs.meta +++ b/Assets/OneStoreCorpPlugins/AppLicenseChecker/Runtime/Scripts/OneStoreAppLicenseCheckerImpl.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b3b4c2e72d54a47089f9924b864c1073 +guid: 67da1af35e6ff4d7696b6e38fac9e567 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Authentication.meta b/Assets/OneStoreCorpPlugins/Authentication.meta index 12ea0eb..c0ef6c8 100644 --- a/Assets/OneStoreCorpPlugins/Authentication.meta +++ b/Assets/OneStoreCorpPlugins/Authentication.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 23c72fe8a92df4875bbe0b34fd3baf78 +guid: 7c7dbd20a57f34f549514b36c28c2464 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Authentication/Proguard.meta b/Assets/OneStoreCorpPlugins/Authentication/Proguard.meta index 4242cb1..1638ba8 100644 --- a/Assets/OneStoreCorpPlugins/Authentication/Proguard.meta +++ b/Assets/OneStoreCorpPlugins/Authentication/Proguard.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 80a4911cfab194fc0bfd87f745cba5de +guid: 865f0763c3a514f71952dafdcdd70025 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Authentication/Proguard/auth-proguard.txt.meta b/Assets/OneStoreCorpPlugins/Authentication/Proguard/auth-proguard.txt.meta index 3df8c08..d8cafcb 100644 --- a/Assets/OneStoreCorpPlugins/Authentication/Proguard/auth-proguard.txt.meta +++ b/Assets/OneStoreCorpPlugins/Authentication/Proguard/auth-proguard.txt.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 88896edd6f04a49948dc1bce81c814ac +guid: 5fddbfe50d40c4e42b3ef7bc7b0a4007 TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/OneStoreCorpPlugins/Authentication/Runtime.meta b/Assets/OneStoreCorpPlugins/Authentication/Runtime.meta index 3430fd6..3931bf0 100644 --- a/Assets/OneStoreCorpPlugins/Authentication/Runtime.meta +++ b/Assets/OneStoreCorpPlugins/Authentication/Runtime.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 37cb852ebcdd54283a52d99a5cc86f96 +guid: 5ea618f5f42c04bb4b0fbe8a4e06bc28 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts.meta b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts.meta index ef5f251..25135cd 100644 --- a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts.meta +++ b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 59f7259c06ccb4c589db49c97df7a643 +guid: 4591019618cbc44098c4780faff6edab folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal.meta b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal.meta index 3425e72..938a766 100644 --- a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal.meta +++ b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 67a438630cf644db58c0badde6a4d803 +guid: d281333515ded4eb491b21fc3cd2ca4f folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/AuthHelper.cs b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/AuthHelper.cs index f530a70..67e2229 100644 --- a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/AuthHelper.cs +++ b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/AuthHelper.cs @@ -1,23 +1,16 @@ using System; using UnityEngine; -using OneStore.Common; -using OneStore.Auth; +using Logger = OneStore.Common.OneStoreLogger; namespace OneStore.Auth.Internal { - public class AuthHelper + public static class AuthHelper { - private readonly OneStoreLogger _logger; - public AuthHelper(OneStoreLogger logger) - { - _logger = logger; - } - /// /// Parses the SignIn results returned by Gaa Auth Client. /// /// The SignInResult that indicates the outcome of the Java SignInResult. - public SignInResult ParseJavaSignInpResult(AndroidJavaObject javaSignInResult) + public static SignInResult ParseJavaSignInpResult(AndroidJavaObject javaSignInResult) { var code = javaSignInResult.Call("getCode"); var message = javaSignInResult.Call("getMessage"); @@ -29,7 +22,7 @@ namespace OneStore.Auth.Internal /// Parses the SignInResults returned by Gaa SignIn Client. /// /// Returns the code value of the SignInResult in ResponseCode. - public ResponseCode GetResponseCodeFromSignInResult(SignInResult signInResult) + public static ResponseCode GetResponseCodeFromSignInResult(SignInResult signInResult) { var resultResponseCode = ResponseCode.RESULT_ERROR; try @@ -38,11 +31,11 @@ namespace OneStore.Auth.Internal } catch (ArgumentNullException) { - _logger.Error("Missing response code, return ResponseCode.RESULT_ERROR."); + Logger.Error("Missing response code, return ResponseCode.RESULT_ERROR."); } catch (ArgumentException) { - _logger.Error("Unknown response code {0}, return ResponseCode.RESULT_ERROR.", signInResult.Code); + Logger.Error("Unknown response code {0}, return ResponseCode.RESULT_ERROR.", signInResult.Code); } return resultResponseCode; } diff --git a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/AuthHelper.cs.meta b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/AuthHelper.cs.meta index 41bb7d0..f04eb65 100644 --- a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/AuthHelper.cs.meta +++ b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/AuthHelper.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3f5d217fdb8804701ba32cd03e453cee +guid: a1f867c7b662d4b22933c64ffc9ce2e0 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/Constants.cs b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/Constants.cs index 68ae46e..1cc1472 100644 --- a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/Constants.cs +++ b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/Constants.cs @@ -4,7 +4,7 @@ namespace OneStore.Auth.Internal { internal static class Constants { - public const string Version = "1.1.2"; + public const string Version = "1.2.1"; public static readonly TimeSpan AsyncTimeout = TimeSpan.FromMilliseconds(30000); diff --git a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/Constants.cs.meta b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/Constants.cs.meta index d0e8d10..f3aaa5e 100644 --- a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/Constants.cs.meta +++ b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/Constants.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 027b0062071924b73be50dbe31e00d63 +guid: 58c615962d2e144dea4a9517a4ad1d80 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/OnAuthListener.cs.meta b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/OnAuthListener.cs.meta index 65fb82d..af1e67e 100644 --- a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/OnAuthListener.cs.meta +++ b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/Internal/OnAuthListener.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b51bc302fe47f44ffba8d75820917107 +guid: 22253330bda434f55a0401ca5944c271 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/OneStoreAuthClientImpl.cs b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/OneStoreAuthClientImpl.cs index 143699d..5250e2a 100644 --- a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/OneStoreAuthClientImpl.cs +++ b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/OneStoreAuthClientImpl.cs @@ -5,35 +5,54 @@ using System; using OneStore.Common; using OneStore.Auth.Internal; using UnityEngine; +using Logger = OneStore.Common.OneStoreLogger; namespace OneStore.Auth { public class OneStoreAuthClientImpl { private AndroidJavaObject _signInClient; - private readonly OneStoreLogger _logger; - private readonly AuthHelper _authHelper; + + /// + /// Initializes the ONE store authentication client. + /// Ensures that the platform is Android before proceeding. + /// public OneStoreAuthClientImpl() { if (Application.platform != RuntimePlatform.Android) { throw new PlatformNotSupportedException("Operation is not supported on this platform."); } - - _logger = new OneStoreLogger(); - _authHelper = new AuthHelper(_logger); } + /// + /// Attempts to sign in silently using a stored login token. + /// This method can only be called in the background. + /// + /// Callback function to handle the sign-in result. public void SilentSignIn(Action callback) { SignInInternal(true, callback); } + /// + /// Attempts to sign in using the stored login token first. + /// If silent login fails, a login screen is displayed to prompt the user to log in. + /// This method must be called in the foreground. + /// + /// Callback function to handle the sign-in result. public void LaunchSignInFlow(Action callback) { SignInInternal(false, callback); } + /// + /// Handles the sign-in process. + /// If `isSilent` is true, a silent login is attempted. + /// If `isSilent` is false or the silent login fails, a login screen is displayed. + /// + /// Determines whether the sign-in should be silent. + /// Callback function to return the sign-in result. private void SignInInternal(bool isSilent, Action callback) { var context = JniHelper.GetApplicationContext(); @@ -42,11 +61,11 @@ namespace OneStore.Auth var authListener = new OnAuthListener(); authListener.OnAuthResponse += (javaSignInResult) => { - var signInResult = _authHelper.ParseJavaSignInpResult(javaSignInResult); - var responseCode = _authHelper.GetResponseCodeFromSignInResult(signInResult); + var signInResult = AuthHelper.ParseJavaSignInpResult(javaSignInResult); + var responseCode = AuthHelper.GetResponseCodeFromSignInResult(signInResult); if (responseCode != ResponseCode.RESULT_OK) { - _logger.Error("Failed to signIn with error code {0} and message: {1}", signInResult.Code, signInResult.Message); + Logger.Error("Failed to signIn with error code {0} and message: {1}", signInResult.Code, signInResult.Message); } RunOnMainThread(() => callback?.Invoke(signInResult)); @@ -95,6 +114,10 @@ namespace OneStore.Auth // ); // } + /// + /// Runs the provided action on the main thread. + /// + /// The action to execute on the main thread. private void RunOnMainThread(Action action) { OneStoreDispatcher.RunOnMainThread(() => action()); diff --git a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/OneStoreAuthClientImpl.cs.meta b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/OneStoreAuthClientImpl.cs.meta index 288bb98..6aadc61 100644 --- a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/OneStoreAuthClientImpl.cs.meta +++ b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/OneStoreAuthClientImpl.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 280e837976a7c4756b3e0192e35e2f47 +guid: a9230c0d3e676444fbaf4c6c5a3307e5 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/ResponseCode.cs.meta b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/ResponseCode.cs.meta index ff37590..10f307a 100644 --- a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/ResponseCode.cs.meta +++ b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/ResponseCode.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b25dbdcc8597f45a8a4b91aabb30699b +guid: 2dce71f6a2a1f4749b65c5fd1f63d10d MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/SignInResult.cs.meta b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/SignInResult.cs.meta index 1266608..dab4c82 100644 --- a/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/SignInResult.cs.meta +++ b/Assets/OneStoreCorpPlugins/Authentication/Runtime/Scripts/SignInResult.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: dc2db6a2e4d914f69887793389752e1a +guid: 4915e45c611874c7ebd04bbfe73351cd MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Common.meta b/Assets/OneStoreCorpPlugins/Common.meta index ced420a..9caa3f6 100644 --- a/Assets/OneStoreCorpPlugins/Common.meta +++ b/Assets/OneStoreCorpPlugins/Common.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: dbbed83b03870418fadb93987e8444e3 +guid: 1a1f1e2fd32df4b41aebf90b5a83074b folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Common/Proguard.meta b/Assets/OneStoreCorpPlugins/Common/Proguard.meta index 8440cb2..c8a8572 100644 --- a/Assets/OneStoreCorpPlugins/Common/Proguard.meta +++ b/Assets/OneStoreCorpPlugins/Common/Proguard.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9ecc0d0eb034b4728b627f98121eaf98 +guid: 84eca2a2ddc984d44a706d98801f3906 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Common/Proguard/core-proguard.txt b/Assets/OneStoreCorpPlugins/Common/Proguard/core-proguard.txt index ba662d7..7c5ab86 100644 --- a/Assets/OneStoreCorpPlugins/Common/Proguard/core-proguard.txt +++ b/Assets/OneStoreCorpPlugins/Common/Proguard/core-proguard.txt @@ -22,3 +22,7 @@ -keep class com.gaa.sdk.base.ResultListener { *; } -keep class com.gaa.sdk.base.Utils { *; } + +-keep class com.gaa.sdk.base.StoreEnvironment ( + public *; + ) diff --git a/Assets/OneStoreCorpPlugins/Common/Proguard/core-proguard.txt.meta b/Assets/OneStoreCorpPlugins/Common/Proguard/core-proguard.txt.meta index 0263140..61bcd32 100644 --- a/Assets/OneStoreCorpPlugins/Common/Proguard/core-proguard.txt.meta +++ b/Assets/OneStoreCorpPlugins/Common/Proguard/core-proguard.txt.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5bd27940027ea4339a48c16d7397de38 +guid: 086e6716fd1c140ab8c1900df67960d6 TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/OneStoreCorpPlugins/Common/Runtime.meta b/Assets/OneStoreCorpPlugins/Common/Runtime.meta index ff63048..5ffbe69 100644 --- a/Assets/OneStoreCorpPlugins/Common/Runtime.meta +++ b/Assets/OneStoreCorpPlugins/Common/Runtime.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 20d274d91b62b40aa87642481e9e31b3 +guid: 0e7f3f62a1d934afa8c5a50871b4e961 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts.meta b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts.meta index da56521..80b480e 100644 --- a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts.meta +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 51b187192c98746c38f9f3fef6d5f77d +guid: c890dfc1dbfab44d9b5708963c3ac833 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal.meta b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal.meta index 1b98ab4..8f14c33 100644 --- a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal.meta +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ccbf429e4c2a44d0a8b32088c56ac6b3 +guid: 5a270edd7fdb445bdac56df23638c238 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal/Constants.cs b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal/Constants.cs new file mode 100644 index 0000000..d4e3fd0 --- /dev/null +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal/Constants.cs @@ -0,0 +1,15 @@ +using System; + +namespace OneStore.Common.Internal +{ + internal static class Constants + { + public const string Version = "1.2.1"; + + public const string SdkLogger = "com.gaa.sdk.base.Logger"; + public const string SdkLoggerSetLogLevelMethod = "setLogLevel"; + public const string ResultListener = "com.gaa.sdk.base.ResultListener"; + public const string StoreEnvironment = "com.gaa.sdk.base.StoreEnvironment"; + public const string StoreEnvironmentGetStoreTypeMethod = "getStoreType"; + } +} \ No newline at end of file diff --git a/Assets/Keystore Helper/Editor/KeystoreHelper.cs.meta b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal/Constants.cs.meta similarity index 68% rename from Assets/Keystore Helper/Editor/KeystoreHelper.cs.meta rename to Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal/Constants.cs.meta index d75422a..7b826f9 100644 --- a/Assets/Keystore Helper/Editor/KeystoreHelper.cs.meta +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal/Constants.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: 9d86995d9257a440c907fae32aa2fa18 -timeCreated: 1458309246 -licenseType: Store +guid: 26e8301dedd9c4d8cb5c5becbeb6089d MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal/ResultListener.cs b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal/ResultListener.cs index 94b070c..fc7b4bc 100644 --- a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal/ResultListener.cs +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal/ResultListener.cs @@ -7,7 +7,7 @@ namespace OneStore.Common.Internal { public event Action OnResponse = delegate { }; - public ResultListener() : base("com.gaa.sdk.base.ResultListener") { } + public ResultListener() : base(Constants.ResultListener) { } void onResponse(int code, string message) { diff --git a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal/ResultListener.cs.meta b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal/ResultListener.cs.meta index 099b01a..fc9d6ba 100644 --- a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal/ResultListener.cs.meta +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/Internal/ResultListener.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 12d01ff0c86d5497a9748ae538253a5f +guid: 2cf2f0ceed6a040e68e5620fcb8f7b42 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/JniHelper.cs b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/JniHelper.cs index 34802ce..c07305f 100644 --- a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/JniHelper.cs +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/JniHelper.cs @@ -2,7 +2,7 @@ using UnityEngine; #if UNITY_ANDROID || !UNITY_EDITOR namespace OneStore.Common { - public class JniHelper + public static class JniHelper { /// /// Returns the Android activity context of the Unity app. diff --git a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/JniHelper.cs.meta b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/JniHelper.cs.meta index 814ea67..35065c8 100644 --- a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/JniHelper.cs.meta +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/JniHelper.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4e1f0f7aabbc646afa163a77e8d8910f +guid: 97c7b848926a1402e8b15c9348a47853 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/OneStoreDispatcher.cs.meta b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/OneStoreDispatcher.cs.meta index 2e7db5a..069c67d 100644 --- a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/OneStoreDispatcher.cs.meta +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/OneStoreDispatcher.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3492da76c2c644025b0f367f039ed0cd +guid: 1d74f11dbf39a4acc97dc280c1e23d1b MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/OneStoreLogger.cs b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/OneStoreLogger.cs index de20c9c..0dd3d0d 100644 --- a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/OneStoreLogger.cs +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/OneStoreLogger.cs @@ -1,25 +1,45 @@ using UnityEngine; +using OneStore.Common.Internal; +using System; namespace OneStore.Common { - public class OneStoreLogger + public static class OneStoreLogger { private const string TAG = "ONE Store: "; - private readonly ILogger _logger = Debug.unityLogger; + private static readonly ILogger _logger = Debug.unityLogger; + + private static int _logLevel = 4; // default: 4 (android.util.Log.INFO) /// - /// Logs a formatted message with ILogger. + /// Logs a verbose-level message (for detailed debugging). + /// This message will only be logged if log level is 2 or higher. /// - public void Log(string format, params object[] args) + public static void Verbose(string format, params object[] args) { - _logger.LogFormat(LogType.Log, TAG + format, args); + if (_logLevel >= 2) + { + _logger.LogFormat(LogType.Log, TAG + format, args); + } + } + + /// + /// Logs a standard log message (informational). + /// This message will only be logged if log level is 4 or higher. + /// + public static void Log(string format, params object[] args) + { + if (_logLevel >= 4) + { + _logger.LogFormat(LogType.Log, TAG + format, args); + } } /// /// Logs a formatted warning message with ILogger. /// - public void Warning(string format, params object[] args) + public static void Warning(string format, params object[] args) { _logger.LogFormat(LogType.Warning, TAG + format, args); } @@ -27,11 +47,19 @@ namespace OneStore.Common /// /// Logs a formatted error message with ILogger. /// - public void Error(string format, params object[] args) + public static void Error(string format, params object[] args) { _logger.LogFormat(LogType.Error, TAG + format, args); } + /// + /// Logs an exception with full stack trace. + /// + public static void Exception(Exception exception) + { + _logger.LogException(exception); + } + /// /// Sets the log level of the library For the convenience of development.
/// Caution! When deploying an app, you must set the logging level to its default value.
@@ -40,8 +68,18 @@ namespace OneStore.Common /// default: 4 (android.util.Log.INFO) public static void SetLogLevel(int level) { - var sdkLogger = new AndroidJavaObject("com.gaa.sdk.base.Logger"); - sdkLogger.CallStatic("setLogLevel", level); + _logLevel = level; + var sdkLogger = new AndroidJavaObject(Constants.SdkLogger); + sdkLogger.CallStatic(Constants.SdkLoggerSetLogLevelMethod, level); + } + + /// + /// Enables or disables detailed debug logging for development purposes. + /// When enabled, sets log level to VERBOSE (2); otherwise, sets it to INFO (4). + /// + public static void EnableDebugLog(bool enable) + { + SetLogLevel(enable ? 2 : 4); } } } diff --git a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/OneStoreLogger.cs.meta b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/OneStoreLogger.cs.meta index 7926eed..91964d0 100644 --- a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/OneStoreLogger.cs.meta +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/OneStoreLogger.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5cc3b668dd9c3455fa9172b1636ccfef +guid: 793d3dd6ce8fa47229c0da7e96c453d2 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/PropertiesFile.cs.meta b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/PropertiesFile.cs.meta index 6de2419..419a610 100644 --- a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/PropertiesFile.cs.meta +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/PropertiesFile.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 995455e74dfb14e2b9d0c04ffee2da4b +guid: 31f0bcacb83d74c12a02c326642286f7 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/StoreEnvironment.cs b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/StoreEnvironment.cs new file mode 100644 index 0000000..998362c --- /dev/null +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/StoreEnvironment.cs @@ -0,0 +1,36 @@ +using UnityEngine; +using OneStore.Common.Internal; +using System; + +namespace OneStore.Common +{ + /// + /// The StoreEnvironment class is responsible for determining the type of store where the app is installed. + /// + public class StoreEnvironment + { + /// + /// Represents the StoreEnvironment Java class. + /// + private static readonly AndroidJavaClass storeEnvironmentClass = new AndroidJavaClass(Constants.StoreEnvironment); + + /// + /// Determines the store type where the app was installed.
+ ///
+ /// @return One of the following values:
+ /// - : Installed from ONE Store or a trusted store.
+ /// - : Installed from Google Play Store.
+ /// - : Installed from other stores.
+ /// - : Store information is unknown.
+ ///
+ /// A value representing the app's installation source. + public static StoreType GetStoreType() + { + var storeTypeValue = storeEnvironmentClass.CallStatic( + Constants.StoreEnvironmentGetStoreTypeMethod, + JniHelper.GetApplicationContext() + ); + return Enum.IsDefined(typeof(StoreType), storeTypeValue) ? (StoreType)storeTypeValue : StoreType.UNKNOWN; + } + } +} diff --git a/Assets/Keystore Helper/Editor/AndroidKeystoreLoader.cs.meta b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/StoreEnvironment.cs.meta similarity index 68% rename from Assets/Keystore Helper/Editor/AndroidKeystoreLoader.cs.meta rename to Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/StoreEnvironment.cs.meta index 150415c..954f1d4 100644 --- a/Assets/Keystore Helper/Editor/AndroidKeystoreLoader.cs.meta +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/StoreEnvironment.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 -guid: ae0d8bec6856f45db890916bc274a00e -timeCreated: 1458310695 -licenseType: Store +guid: 21c8b93fdb49b465fa4a680ebe84c984 MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/StoreType.cs b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/StoreType.cs new file mode 100644 index 0000000..fc70fa3 --- /dev/null +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/StoreType.cs @@ -0,0 +1,28 @@ +namespace OneStore.Common +{ + /// + /// It is a constant that represents the type of store where the app is installed. + /// + public enum StoreType + { + /// + /// Unable to determine the store (APK sideloaded, unknown source) + /// + UNKNOWN = 0, + + /// + /// Installed from ONE Store (or a trusted store defined in Developer Options) + /// + ONESTORE = 1, + + /// + /// Installed from Google Play Store + /// + VENDING = 2, + + /// + /// Installed from other stores (Samsung Galaxy Store, Amazon Appstore, etc.) + /// + ETC = 3, + } +} diff --git a/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/StoreType.cs.meta b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/StoreType.cs.meta new file mode 100644 index 0000000..3401ad9 --- /dev/null +++ b/Assets/OneStoreCorpPlugins/Common/Runtime/Scripts/StoreType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3aa30d9ec3feb4512a41a68db5646ecc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/OneStoreCorpPlugins/LICENSE.meta b/Assets/OneStoreCorpPlugins/LICENSE.meta index d84c653..e7f13c9 100644 --- a/Assets/OneStoreCorpPlugins/LICENSE.meta +++ b/Assets/OneStoreCorpPlugins/LICENSE.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 83431c64bc5d94a78aacc7b562db1795 +guid: 864ad717c4e614bc0a9db4fa2c3aae0e DefaultImporter: externalObjects: {} userData: diff --git a/Assets/OneStoreCorpPlugins/Purchase.meta b/Assets/OneStoreCorpPlugins/Purchase.meta index c8c5423..fc4802d 100644 --- a/Assets/OneStoreCorpPlugins/Purchase.meta +++ b/Assets/OneStoreCorpPlugins/Purchase.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 541cf0e43641147f394d8a32b3089905 +guid: 635a0593099484eeb86843341155efba folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Purchase/Editor.meta b/Assets/OneStoreCorpPlugins/Purchase/Editor.meta index 991d167..4d9055b 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Editor.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Editor.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 590b8eb656428488cbe0514881515afa +guid: c3fabc56fd842463bb99c8e57c758680 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml b/Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml index b75b827..9d2bd52 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml +++ b/Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml @@ -1,8 +1,8 @@ - https://repo.onestore.co.kr/repository/onestore-sdk-public + https://repo.onestore.net/repository/onestore-sdk-public - + diff --git a/Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml.meta b/Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml.meta index 4b12959..f66118e 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8abdc96158a994b00aa31af2ac0db879 +guid: ab974bc6d99964828895de1da9e0c67f TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/OneStoreCorpPlugins/Purchase/Proguard.meta b/Assets/OneStoreCorpPlugins/Purchase/Proguard.meta index 656954f..b7294f4 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Proguard.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Proguard.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8580b732c1a9046189d398e4d902d356 +guid: a8be89816d0a4449cafdf9261fa82e9a folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Purchase/Proguard/purchasing-proguard.txt.meta b/Assets/OneStoreCorpPlugins/Purchase/Proguard/purchasing-proguard.txt.meta index bf65c26..ce097b4 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Proguard/purchasing-proguard.txt.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Proguard/purchasing-proguard.txt.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d78bc3a00355f497383963c097da7fb1 +guid: 2045a161414604bdfbb2c575c52b481b TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime.meta index 4ee29cd..125883e 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 453ae0db519424f768b7e47dd4d770de +guid: 24f8ee9b2400c4066b0213141214b350 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts.meta index 1f20fd4..b2893f2 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 6579c52c9a84e40b19c6950f8940812e +guid: 4a46668187d28471caa65849b3f5d7d0 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/AcknowledgeState.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/AcknowledgeState.cs.meta index 5e88488..5397fcd 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/AcknowledgeState.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/AcknowledgeState.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 44f6c5580605e496790f90e64628d10f +guid: 24484c467aa7d4ce181da6d1e4725c3a MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/IPurchaseCallback.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/IPurchaseCallback.cs.meta index 87ad0f3..66a192e 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/IPurchaseCallback.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/IPurchaseCallback.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 087121c8ffc51413ea4b6cfbcd4da6f1 +guid: 7059e457b5e6b4063940b27d33e320ce MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/IPurchaseExtensions.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/IPurchaseExtensions.cs.meta index aab39e4..baf5c28 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/IPurchaseExtensions.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/IPurchaseExtensions.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 45a88cb38305847f993f7a92dc762864 +guid: 9747ed7e096c34dcc8c17ecb12d0319a MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/IapResult.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/IapResult.cs.meta index cac41bb..99b5768 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/IapResult.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/IapResult.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0930120a3615c46759a4ba4487fbf6ea +guid: a85708d2f7eb44faf95f4134caeeab20 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal.meta index 317cec3..8cb7bfc 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d92232be28e1b42c39e526e00611a8de +guid: 8646eff21cc32420c8226a4da4c4ae39 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/AcknowledgeListener.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/AcknowledgeListener.cs.meta index 00abf65..e42056e 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/AcknowledgeListener.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/AcknowledgeListener.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 75bcc9e21ba7e4b2aa4a48ff1f7f8776 +guid: a74d8f7ec29824f25b20deb0e8e1c9b2 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/Constants.cs b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/Constants.cs index 95d7869..769c792 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/Constants.cs +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/Constants.cs @@ -4,7 +4,7 @@ namespace OneStore.Purchasing.Internal { internal static class Constants { - public const string Version = "21.01.00"; + public const string Version = "21.02.01"; public static readonly TimeSpan AsyncTimeout = TimeSpan.FromMilliseconds(30000); diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/Constants.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/Constants.cs.meta index 2c62dda..da418af 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/Constants.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/Constants.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8e64f61104c86498aa934fa89bd417f6 +guid: 1461d8108bf7e4400996432a42335571 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/ConsumeListener.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/ConsumeListener.cs.meta index f61f3f6..57bad90 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/ConsumeListener.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/ConsumeListener.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c06b2c2e4a7364c3696ba84e0be1e9a9 +guid: d46db22ec1a8144ed9dad5701acca54e MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/IapHelper.cs b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/IapHelper.cs index c89e415..4021fc6 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/IapHelper.cs +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/IapHelper.cs @@ -3,25 +3,21 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; using OneStore.Common; +using Logger = OneStore.Common.OneStoreLogger; namespace OneStore.Purchasing.Internal { /// /// A collection of utils methods to process AndroidJavaObject returned by Gaa Purchasing Library. /// - public class IapHelper + public static class IapHelper { - private readonly OneStoreLogger _logger; - public IapHelper(OneStoreLogger logger) - { - _logger = logger; - } /// /// Parses the Iap results returned by Gaa Purchasing Client. /// /// The IapResult that indicates the outcome of the Java IapResult. - public IapResult ParseJavaIapResult(AndroidJavaObject javaIapResult) + public static IapResult ParseJavaIapResult(AndroidJavaObject javaIapResult) { var code = javaIapResult.Call("getResponseCode"); var message = javaIapResult.Call("getMessage"); @@ -33,7 +29,7 @@ namespace OneStore.Purchasing.Internal /// Parses the IapResults returned by Gaa Purchasing Client. ///
/// Returns the code value of the IapResult in ResponseCode. - public ResponseCode GetResponseCodeFromIapResult(IapResult iapResult) + public static ResponseCode GetResponseCodeFromIapResult(IapResult iapResult) { var resultResponseCode = ResponseCode.RESULT_ERROR; try @@ -42,11 +38,11 @@ namespace OneStore.Purchasing.Internal } catch (ArgumentNullException) { - _logger.Error("Missing response code, return ResponseCode.RESULT_ERROR."); + Logger.Error("Missing response code, return ResponseCode.RESULT_ERROR."); } catch (ArgumentException) { - _logger.Error("Unknown response code {0}, return ResponseCode.RESULT_ERROR.", iapResult.Code); + Logger.Error("Unknown response code {0}, return ResponseCode.RESULT_ERROR.", iapResult.Code); } return resultResponseCode; } @@ -55,12 +51,12 @@ namespace OneStore.Purchasing.Internal /// Parses the ProductDetail list results returned by the Gaa Purchasing Library. ///
/// An IEnumerable of . The IEnumerable could be empty. - public IEnumerable ParseProductDetailsResult(AndroidJavaObject javaIapResult, AndroidJavaObject productDetailsList) + public static IEnumerable ParseProductDetailsResult(AndroidJavaObject javaIapResult, AndroidJavaObject productDetailsList) { var iapResult = ParseJavaIapResult(javaIapResult); if (!iapResult.IsSuccessful()) { - _logger.Warning("Failed to retrieve products information! Error code {0}, message: {1}.", + Logger.Warning("Failed to retrieve products information! Error code {0}, message: {1}.", iapResult.Code, iapResult.Message); return Enumerable.Empty(); } @@ -71,6 +67,8 @@ namespace OneStore.Purchasing.Internal { var javaProductDetail = productDetailsList.Call("get", i); var originalJson = javaProductDetail.Call(Constants.ProductDetailGetOriginalJson); + Logger.Verbose("ParseProductDetailsResult: originalJson: {0}", originalJson); + ProductDetail productDetail; if (ProductDetail.FromJson(originalJson, out productDetail)) { @@ -78,7 +76,7 @@ namespace OneStore.Purchasing.Internal } else { - _logger.Warning("Failed to parse productDetails {0} ", originalJson); + Logger.Warning("Failed to parse productDetails {0} ", originalJson); } } @@ -89,7 +87,7 @@ namespace OneStore.Purchasing.Internal /// Parses the Java list of purchaseData list returned by the Gaa Purchasing Library. /// /// An IEnumerable of . The IEnumerable could be empty. - public IEnumerable ParseJavaPurchasesList(AndroidJavaObject javaPurchasesList) + public static IEnumerable ParseJavaPurchasesList(AndroidJavaObject javaPurchasesList) { var parsedPurchasesList = new List(); var size = javaPurchasesList.Call("size"); @@ -98,6 +96,8 @@ namespace OneStore.Purchasing.Internal var javaPurchase = javaPurchasesList.Call("get", i); var originalJson = javaPurchase.Call(Constants.PurchaseDataGetOriginalJsonMethod); var signature = javaPurchase.Call(Constants.PurchaseDataGetSignatureMethod); + Logger.Verbose("ParseJavaPurchasesList: originalJson: {0}, signature: {1}", originalJson, signature); + PurchaseData purchaseData; if (PurchaseData.FromJson(originalJson, signature, out purchaseData)) { @@ -105,23 +105,22 @@ namespace OneStore.Purchasing.Internal } else { - _logger.Warning("Failed to parse purchase {0} ", originalJson); + Logger.Warning("Failed to parse purchase {0} ", originalJson); } } return parsedPurchasesList; } - public PurchaseData ParseJavaPurchaseData(AndroidJavaObject javaPurchaseData) + public static PurchaseData ParseJavaPurchaseData(AndroidJavaObject javaPurchaseData) { - var originalJson = javaPurchaseData.Call("getOriginalJson"); - var signature = javaPurchaseData.Call("getSignature"); - PurchaseData purchaseData; - if (PurchaseData.FromJson(originalJson, signature, out purchaseData)) + var originalJson = javaPurchaseData.Call(Constants.PurchaseDataGetOriginalJsonMethod); + var signature = javaPurchaseData.Call(Constants.PurchaseDataGetSignatureMethod); + if (PurchaseData.FromJson(originalJson, signature, out PurchaseData purchaseData)) { return purchaseData; } - + return null; } @@ -146,7 +145,7 @@ namespace OneStore.Purchasing.Internal // var responseCode = GetResponseCodeFromIapResult(iapResult); // if (responseCode != ResponseCode.RESULT_OK) // { - // _logger.Error("Failed to retrieve purchases information! Error code {0}, message: {1}.", + // Logger.Error("Failed to retrieve purchases information! Error code {0}, message: {1}.", // iapResult.Code, iapResult.Message); // return Enumerable.Empty(); // } diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/IapHelper.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/IapHelper.cs.meta index bd1d71f..251b809 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/IapHelper.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/IapHelper.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9ff3024883f804d08918d7b14baefb97 +guid: 826c4b35303374ef896b7eb23d2a3c16 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/IapResultListener.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/IapResultListener.cs.meta index 91bf428..9ac0c4f 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/IapResultListener.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/IapResultListener.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ea27d8035db8f4f2c9351525e474d806 +guid: 7545e6e6d3d4d447788110bef866985c MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/OneStorePurchasingInventory.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/OneStorePurchasingInventory.cs.meta index c5035e6..ee47297 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/OneStorePurchasingInventory.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/OneStorePurchasingInventory.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c4bf13942066d4db495cb8ac556789ae +guid: c5efe3bf23765426bbaf92f82f5cbd20 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/ProductDetailsListener.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/ProductDetailsListener.cs.meta index 323ebd3..412e756 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/ProductDetailsListener.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/ProductDetailsListener.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 161f62becd9884402b9930107ce68982 +guid: 709f0596b6b8c4b6b9b64b5a836c6b79 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/PurchaseClientStateListener.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/PurchaseClientStateListener.cs.meta index 5ef85e9..85d83e3 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/PurchaseClientStateListener.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/PurchaseClientStateListener.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: fb1ca6ef17e26421e80445ad6a286245 +guid: ef9e60b8602a8459885a544273a4f4da MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/PurchasesUpdatedListener.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/PurchasesUpdatedListener.cs.meta index 13fbff7..3a05174 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/PurchasesUpdatedListener.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/PurchasesUpdatedListener.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 099220b88e8f14b1e8c20a94af76e7a3 +guid: a46dd76b0654b4ace8018eed3ad0602c MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/QueryPurchasesListener.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/QueryPurchasesListener.cs.meta index fdc8e17..e9ae62e 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/QueryPurchasesListener.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/QueryPurchasesListener.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 32cccf6915cf74937be26ca1674b1e4b +guid: 107a553b495544bfca51807e3ce88f93 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/RecurringProductListener.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/RecurringProductListener.cs.meta index f739e10..f8844c4 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/RecurringProductListener.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/RecurringProductListener.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 3075a4c0c070a495cb198e9747e9c981 +guid: fe478ec6c9d4e4a0db2e2cce3ae4d4cf MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/StoreInfoListener.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/StoreInfoListener.cs.meta index 0e6d7aa..532b746 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/StoreInfoListener.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/Internal/StoreInfoListener.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5eabc8ed8e0e340b79d53d6c47f553e1 +guid: c214bbaa82deb465c8dc0d33eb013bd1 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/OneStoreProrationMode.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/OneStoreProrationMode.cs.meta index af55432..ae39ff6 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/OneStoreProrationMode.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/OneStoreProrationMode.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 74e6007e0cb824d73803296c1ac942a3 +guid: 7f238cae7b9d94d84adda85b667ecdad MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ProductDetail.cs b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ProductDetail.cs index bee6686..caaf5af 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ProductDetail.cs +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ProductDetail.cs @@ -1,6 +1,7 @@ using System; using UnityEngine; using OneStore.Purchasing.Internal; +using Logger = OneStore.Common.OneStoreLogger; namespace OneStore.Purchasing { @@ -41,8 +42,10 @@ namespace OneStore.Purchasing productDetail.JsonProductDetail = jsonProductDetail; return true; } - catch (Exception) + catch (Exception ex) { + Logger.Error("[ProductDetail]: Failed to parse purchase data: {0}", jsonProductDetail); + Logger.Exception(ex); productDetail = null; return false; } diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ProductDetail.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ProductDetail.cs.meta index 69b57f6..b02f2bc 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ProductDetail.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ProductDetail.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4891df32dba4642319f9e2d48e6923a5 +guid: cc5c07c0c0c584c418d11f3ce55ef7d8 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ProductType.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ProductType.cs.meta index 3d5b492..d4c263f 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ProductType.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ProductType.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 82e8e1ef36f844207ac2a641db1663b2 +guid: b25bfa4e2b7454b6cbd096e9abf46540 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseClientImpl.cs b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseClientImpl.cs index a277095..0b50dba 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseClientImpl.cs +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseClientImpl.cs @@ -7,10 +7,15 @@ using System.Collections.ObjectModel; using System.Linq; using OneStore.Purchasing.Internal; using OneStore.Common; +using Logger = OneStore.Common.OneStoreLogger; using UnityEngine; namespace OneStore.Purchasing { + /// + /// Implementation of the One Store IAP client for Unity. + /// This class handles purchase initialization, product queries, purchase flows, and subscription management. + /// public class PurchaseClientImpl : IPurchaseExtensions { private IPurchaseCallback _callback; @@ -19,8 +24,6 @@ namespace OneStore.Purchasing private PurchasesUpdatedListener _purchaseUpdatedListener; private readonly OneStorePurchasingInventory _inventory; - private readonly OneStoreLogger _logger; - private readonly IapHelper _iapHelper; private volatile string _productInPurchaseFlow; @@ -32,10 +35,16 @@ namespace OneStore.Purchasing private volatile ConnectionStatus _connectionStatus = ConnectionStatus.DISCONNECTED; + /// + /// Enum representing the connection status of the purchase client. + /// private enum ConnectionStatus { DISCONNECTED, CONNECTING, CONNECTED, } + /// + /// Dictionary to track query purchase status for different product types. + /// private volatile Dictionary _queryPurchasesCallStatus = new Dictionary { @@ -44,6 +53,9 @@ namespace OneStore.Purchasing {ProductType.AUTO, AsyncRequestStatus.Succeed}, }; + /// + /// Dictionary to track query product details status for different product types. + /// private volatile Dictionary _queryProductDetailsCallStatus = new Dictionary { @@ -53,11 +65,23 @@ namespace OneStore.Purchasing {ProductType.ALL, AsyncRequestStatus.Succeed}, }; + /// + /// Enum representing the asynchronous request status. + /// private enum AsyncRequestStatus { Pending, Failed, Succeed, } + /// + /// Initializes a new instance of the `PurchaseClientImpl` class with the specified license key. + /// + /// The license key required for authentication with the ONE store IAP SDK. + /// + /// - Checks if the application is running on an Android platform; otherwise, throws a `PlatformNotSupportedException`. + /// - Initializes `_inventory` as an instance of `OneStorePurchasingInventory` to manage purchase data. + /// - Stores the provided `licenseKey` in `_licenseKey` for later use. + /// public PurchaseClientImpl(string licenseKey) { if (Application.platform != RuntimePlatform.Android) @@ -66,11 +90,21 @@ namespace OneStore.Purchasing } _inventory = new OneStorePurchasingInventory(); - _logger = new OneStoreLogger(); - _iapHelper = new IapHelper(_logger); _licenseKey = licenseKey; } + /// + /// Initializes the ONE store IAP client and establishes a connection to the service. + /// + /// The callback interface to handle purchase-related events. + /// + /// - Assigns the provided `callback` to `_callback`. + /// - Creates an instance of `_purchaseClient` using the ONE store IAP SDK. + /// - Retrieves the application context using `JniHelper.GetApplicationContext()`. + /// - Initializes `_purchaseUpdatedListener` to handle purchase updates and assigns `ProcessPurchaseUpdatedResult` as the callback. + /// - Calls `_purchaseClient.Call()` to set up the purchase client with the application context, license key, and purchase listener. + /// - Initiates the service connection using `StartConnection()`, and upon successful connection, retrieves the `storeCode`. + /// public void Initialize(IPurchaseCallback callback) { _callback = callback; @@ -88,16 +122,30 @@ namespace OneStore.Purchasing ); StartConnection(()=> { - _logger.Log("Initialize: Successfully connected to the service."); + Logger.Log("Initialize: Successfully connected to the service."); GetStoreCode(); }); } + /// + /// Initiates a connection to the ONE store IAP service and processes pending requests. + /// + /// The action to execute once the connection is successfully established. + /// + /// - If the client is already connecting (`ConnectionStatus.CONNECTING`), the action is added to `_requestQueue` and logged. + /// - Updates `_connectionStatus` to `CONNECTING` before starting the connection process. + /// - Creates a `PurchaseClientStateListener` to handle connection events: + /// - `OnServiceDisconnected`: Logs a warning, resets `_productInPurchaseFlow`, and sets `_connectionStatus` to `DISCONNECTED`. + /// - `OnSetupFinished`: + /// - If successful, updates `_connectionStatus` to `CONNECTED`, executes the provided action, and processes queued requests. + /// - If failed, logs an error, clears `_requestQueue`, and triggers `OnSetupFailed` callback with the error result. + /// - Calls `_purchaseClient.Call()` to start the connection process. + /// private void StartConnection(Action action) { if (_connectionStatus == ConnectionStatus.CONNECTING) { _requestQueue.Enqueue(action); - _logger.Log("Client is already in the process of connecting to service."); + Logger.Log("Client is already in the process of connecting to service."); return; } @@ -106,14 +154,14 @@ namespace OneStore.Purchasing var purchaseClientStateListener = new PurchaseClientStateListener(); purchaseClientStateListener.OnServiceDisconnected += () => { - _logger.Warning("Client is disconnected from the service."); + Logger.Warning("Client is disconnected from the service."); _productInPurchaseFlow = null; _connectionStatus = ConnectionStatus.DISCONNECTED; }; purchaseClientStateListener.OnSetupFinished += (javaIapResult) => { - var iapResult = _iapHelper.ParseJavaIapResult(javaIapResult); + var iapResult = IapHelper.ParseJavaIapResult(javaIapResult); if (iapResult.IsSuccessful()) { _connectionStatus = ConnectionStatus.CONNECTED; @@ -125,7 +173,7 @@ namespace OneStore.Purchasing } else { - _logger.Error("Failed to connect to service with error code '{0}' and message: '{1}'.", + Logger.Error("Failed to connect to service with error code '{0}' and message: '{1}'.", iapResult.Code, iapResult.Message); _requestQueue.Clear(); @@ -141,6 +189,14 @@ namespace OneStore.Purchasing ); } + /// + /// Executes the given action if the IAP service is connected; otherwise, attempts to establish a connection first. + /// + /// The action to execute once the connection is established. + /// + /// - If `_connectionStatus` is `CONNECTED`, the provided action is immediately executed. + /// - If not connected, `StartConnection(action)` is called to establish a connection before executing the action. + /// private void ExecuteService(Action action) { if (_connectionStatus == ConnectionStatus.CONNECTED) @@ -153,6 +209,10 @@ namespace OneStore.Purchasing } } + /// + /// Ends the connection to the One Store purchase service. + /// This should be called when the application exits or the purchasing service is no longer needed. + /// public void EndConnection() { _productInPurchaseFlow = null; @@ -161,6 +221,18 @@ namespace OneStore.Purchasing _connectionStatus = ConnectionStatus.DISCONNECTED; } + /// + /// Retrieves detailed product information for the given product IDs using the ONE store IAP SDK. + /// + /// A collection of product IDs to query. + /// The type of product to query. + /// + /// - If there is an ongoing request for the given product type, the function returns without executing a new request. + /// - If product details are already available in the local inventory and match the requested product IDs, + /// the details are returned immediately without making a new request. + /// - Otherwise, a request is constructed using `ProductDetailsParamBuilder` and sent through `_purchaseClient.Call()`. + /// - The result is handled by `ProductDetailsListener`, which triggers the appropriate callback upon response. + /// public void QueryProductDetails(ReadOnlyCollection productIds, ProductType type) { if (_queryProductDetailsCallStatus[type] == AsyncRequestStatus.Pending) @@ -203,12 +275,22 @@ namespace OneStore.Purchasing return IsPurchasingServiceAvailable() ? _inventory.GetAllProductDetails() : null; } + /// + /// Queries the non-consumed purchase history for managed products using the ONE store IAP SDK. + /// + /// The type of product to query. Must not be `ProductType.ALL` or `null`. + /// + /// - If `ProductType.ALL` is passed, an error is logged, and the request is rejected, as querying all product types is not supported. + /// - If `type` is `null`, an error is returned indicating an illegal argument. + /// - If there is an ongoing query for the given product type, the function returns without executing another request. + /// - Otherwise, the function sets the request status to `Pending`, then initiates the query using `_purchaseClient.Call()`. + /// public void QueryPurchases(ProductType type) { if (ProductType.ALL == type) { var message = "ProductType.ALL is not supported. This is supported only by the QueryProductDetails."; - _logger.Error(message); + Logger.Error(message); RunOnMainThread(() => _callback.OnPurchaseFailed(new IapResult((int) ResponseCode.ERROR_ILLEGAL_ARGUMENT, message))); return; } @@ -237,12 +319,22 @@ namespace OneStore.Purchasing }); } + /// + /// Initiates a purchase request for a product using the ONE store IAP SDK. + /// + /// The parameters required to process the purchase, including product ID, type, quantity, and additional metadata. + /// + /// - If a purchase is already in progress for another product, the request is rejected, and an error is logged. + /// - The function constructs a `PurchaseFlowParams` object using the provided parameters. + /// - The purchase flow is initiated using the `LaunchPurchaseFlow` method. + /// - The request includes additional metadata such as `ProductName`, `GameUserId`, and whether the product is eligible for promotions. + /// public void Purchase(PurchaseFlowParams purchaseFlowParams) { if (_productInPurchaseFlow != null) { var message = string.Format("A purchase for {0} is already in progress.", _productInPurchaseFlow); - _logger.Error(message); + Logger.Error(message); RunOnMainThread(() => _callback.OnPurchaseFailed(new IapResult((int) ResponseCode.RESULT_ERROR, message))); return; } @@ -274,12 +366,22 @@ namespace OneStore.Purchasing }); } + /// + /// Updates an existing subscription product using the ONE store IAP SDK. + /// + /// The parameters required to process the subscription update, including product ID, type, developer payload, and proration mode. + /// + /// - If a subscription update is already in progress, the request is rejected, and an error is logged. + /// - The function constructs a `PurchaseFlowParams` object using the provided parameters. + /// - A `SubscriptionUpdateParams` object is created to include the proration mode and the old purchase token for the update. + /// - The update request is initiated using the `LaunchPurchaseFlow` method. + /// public void UpdateSubscription(PurchaseFlowParams purchaseFlowParams) { if (_productInPurchaseFlow != null) { var message = string.Format("The update subscription for {0} is already in progress.", _productInPurchaseFlow); - _logger.Error(message); + Logger.Error(message); RunOnMainThread(() => _callback.OnPurchaseFailed(new IapResult((int) ResponseCode.RESULT_ERROR, message))); return; } @@ -325,6 +427,16 @@ namespace OneStore.Purchasing purchaseFlowParamsBuilder.Call(Constants.BuildMethod)); } + /// + /// Consumes a purchased managed product using the ONE store IAP SDK. + /// + /// The purchase data of the managed product to be consumed. + /// + /// - If `purchaseData` is null, the request is rejected, and an error is logged. + /// - The function constructs a `ConsumeParams` object using the provided `purchaseData`. + /// - The consumption request is sent using `_purchaseClient.Call()`. + /// - The result is handled by `ConsumeListener`, which triggers the appropriate callback upon response. + /// public void ConsumePurchase(PurchaseData purchaseData) { if (purchaseData == null) @@ -353,6 +465,19 @@ namespace OneStore.Purchasing }); } + /// + /// Acknowledges a purchased non-consumable or subscription product using the ONE store IAP SDK. + /// + /// The purchase data of the product to be acknowledged. + /// The type of product being acknowledged (must not be `ProductType.ALL` or `null`). + /// + /// - If `purchaseData` is null, the request is rejected, and an error is logged. + /// - If `type` is null, the request is rejected, and an error is logged. + /// - If `type` is `ProductType.ALL`, the request is rejected, as acknowledging all product types is not supported. + /// - The function constructs an `AcknowledgeParams` object using the provided `purchaseData`. + /// - The acknowledgment request is sent using `_purchaseClient.Call()`. + /// - The result is handled by `AcknowledgeListener`, which triggers the appropriate callback upon response. + /// public void AcknowledgePurchase(PurchaseData purchaseData, ProductType type) { if (purchaseData == null) @@ -372,7 +497,7 @@ namespace OneStore.Purchasing else if (ProductType.ALL == type) { var message = "ProductType.ALL is not supported. This is supported only by the QueryProductDetails."; - _logger.Error(message); + Logger.Error(message); RunOnMainThread(() => _callback.OnAcknowledgeFailed(new IapResult((int) ResponseCode.ERROR_ILLEGAL_ARGUMENT, message))); return; } @@ -395,6 +520,19 @@ namespace OneStore.Purchasing }); } + /// + /// Manages an auto product (auto-renewable subscription) using the ONE store IAP SDK. + /// This method is obsolete. + /// + /// The purchase data of the auto product to be managed. + /// The recurring action to be performed (e.g., cancel, pause, resume). + /// + /// - If `purchaseData` is null, the request is rejected, and an error is logged. + /// - If the product type is not `AUTO`, the request is rejected, as only auto products support this feature. + /// - The function constructs a `RecurringProductParams` object using the provided `purchaseData` and `action`. + /// - The request is sent using `_purchaseClient.Call()`. + /// - The result is handled by `RecurringProductListener`, which triggers the appropriate callback upon response. + /// [Obsolete] public void ManageRecurringProduct(PurchaseData purchaseData, RecurringAction action) { @@ -433,12 +571,26 @@ namespace OneStore.Purchasing }); } + /// + /// Launches the update or installation flow for the ONE store IAP SDK. + /// This ensures that the latest version of the ONE store service is installed or updated if necessary. + /// + /// A callback function that receives the result of the update or installation process. + /// + /// - In-app payments cannot be used if the ONE store service is outdated or not installed. + /// - The first API call attempts to connect to the ONE store service. + /// - If `RESULT_NEED_UPDATE` occurs, you must call this method to update or install the service. + /// - The function creates an `IapResultListener` to handle the response. + /// - The result from the Java IAP service is parsed using `IapHelper.ParseJavaIapResult()`. + /// - If the update or installation is successful, the provided callback is invoked with the `IapResult`. + /// - The process is executed via `_purchaseClient.Call()`, which triggers the update or installation flow. + /// public void LaunchUpdateOrInstallFlow(Action callback) { var iapResultListener = new IapResultListener(); iapResultListener.OnResponse += (javaIapResult) => { - var iapResult = _iapHelper.ParseJavaIapResult(javaIapResult); + var iapResult = IapHelper.ParseJavaIapResult(javaIapResult); HandleErrorCode(iapResult, () => { RunOnMainThread(() => callback?.Invoke(iapResult)); }); @@ -451,6 +603,20 @@ namespace OneStore.Purchasing ); } + /// + /// Launches the subscription management screen using the ONE store IAP SDK. + /// + /// + /// The purchase data of the subscription product to manage. + /// If `purchaseData` is provided, the management screen for that specific subscription product is displayed. + /// If `purchaseData` is `null`, the user's subscription list screen is launched. + /// + /// + /// - The function creates a `SubscriptionParamsBuilder` to set the purchase data if available. + /// - If `purchaseData` is provided, the management screen for that specific subscription product is shown. + /// - If `purchaseData` is `null`, the general subscription list screen is displayed. + /// - The function executes `_purchaseClient.Call()` to open the subscription management screen. + /// public void LaunchManageSubscription(PurchaseData purchaseData) { using (var subscriptionParamsBuilder = new AndroidJavaObject(Constants.SubscriptionParamsBuilder)) @@ -468,6 +634,15 @@ namespace OneStore.Purchasing } } + /// + /// Retrieves the market distinction code (storeCode) using the ONE store IAP SDK. + /// This code is required for using the S2S API from SDK v19 onward. + /// + /// + /// - When the `PurchaseClientImpl` object is initialized, the SDK attempts to connect to the payment module. + /// - Upon successful connection, the `storeCode` is automatically obtained and assigned to `PurchaseClientImpl.storeCode`. + /// - This function requests the `storeCode` using `_purchaseClient.Call()` and assigns it upon response. + /// private void GetStoreCode() { var storeCodeListener = new StoreInfoListener(); @@ -479,6 +654,14 @@ namespace OneStore.Purchasing ); } + /// + /// Checks whether the purchasing service is available by verifying the connection status. + /// + /// Returns `true` if the service is connected; otherwise, logs a warning and returns `false`. + /// + /// - If `_connectionStatus` is `CONNECTED`, the function returns `true`, indicating that the purchasing service is available. + /// - If not connected, a warning message is logged, and the function returns `false`. + /// private bool IsPurchasingServiceAvailable() { if (_connectionStatus == ConnectionStatus.CONNECTED) @@ -486,16 +669,29 @@ namespace OneStore.Purchasing return true; } var message = string.Format("Purchasing service unavailable. ConnectionStatus: {0}", _connectionStatus.ToString()); - _logger.Warning(message); + Logger.Warning(message); return false; } + /// + /// Processes the result of a product details query and updates the inventory accordingly. + /// + /// The type of product being queried. + /// The result of the IAP request from the ONE store SDK. + /// The list of product details retrieved from the query. + /// + /// - Parses the IAP result using `IapHelper.ParseJavaIapResult(javaIapResult)`. + /// - If the query fails, logs a warning with the error details and updates the query status as `Failed`. + /// - Handles error cases by invoking `HandleErrorCode(iapResult)`, triggering the `OnProductDetailsFailed` callback. + /// - If successful, parses the product details list and updates the inventory using `_inventory.UpdateProductDetailInventory()`. + /// - Marks the query status as `Succeed` and invokes the `OnProductDetailsSucceeded` callback with the retrieved product details. + /// private void ProcessProductDetailsResult(ProductType type, AndroidJavaObject javaIapResult, AndroidJavaObject javaProductDetailList) { - var iapResult = _iapHelper.ParseJavaIapResult(javaIapResult); + var iapResult = IapHelper.ParseJavaIapResult(javaIapResult); if (!iapResult.IsSuccessful()) { - _logger.Warning("Retrieve product failed with error code '{0}' and message: '{1}'", + Logger.Warning("Retrieve product failed with error code '{0}' and message: '{1}'", iapResult.Code, iapResult.Message); _queryProductDetailsCallStatus[type] = AsyncRequestStatus.Failed; @@ -506,19 +702,32 @@ namespace OneStore.Purchasing return; } - var productDetailList = _iapHelper.ParseProductDetailsResult(javaIapResult, javaProductDetailList); + var productDetailList = IapHelper.ParseProductDetailsResult(javaIapResult, javaProductDetailList); _inventory.UpdateProductDetailInventory(productDetailList); _queryProductDetailsCallStatus[type] = AsyncRequestStatus.Succeed; RunOnMainThread(() => _callback.OnProductDetailsSucceeded(productDetailList.ToList())); } + /// + /// Processes the result of a purchase update and updates the inventory accordingly. + /// + /// The result of the IAP request from the ONE store SDK. + /// The list of purchases retrieved from the query. + /// + /// - Resets `_productInPurchaseFlow` to `null` after the purchase process completes. + /// - Parses the IAP result using `IapHelper.ParseJavaIapResult(javaIapResult)`. + /// - If the purchase fails, logs a warning with the error details and invokes `OnPurchaseFailed` callback. + /// - If the purchase is successful, retrieves the purchase list using `IapHelper.ParseJavaPurchasesList(javaPurchasesList)`. + /// - If any purchases exist, updates the inventory using `_inventory.UpdatePurchaseInventory()`. + /// - Invokes the `OnPurchaseSucceeded` callback with the retrieved purchase list. + /// private void ProcessPurchaseUpdatedResult(AndroidJavaObject javaIapResult, AndroidJavaObject javaPurchasesList) { _productInPurchaseFlow = null; - var iapResult = _iapHelper.ParseJavaIapResult(javaIapResult); + var iapResult = IapHelper.ParseJavaIapResult(javaIapResult); if (!iapResult.IsSuccessful()) { - _logger.Warning("Purchase failed with error code '{0}' and message: '{1}'", + Logger.Warning("Purchase failed with error code '{0}' and message: '{1}'", iapResult.Code, iapResult.Message); HandleErrorCode(iapResult, () => { @@ -527,7 +736,7 @@ namespace OneStore.Purchasing return; } - var purchasesList = _iapHelper.ParseJavaPurchasesList(javaPurchasesList); + var purchasesList = IapHelper.ParseJavaPurchasesList(javaPurchasesList); if (purchasesList.Any()) { _inventory.UpdatePurchaseInventory(purchasesList); @@ -535,13 +744,28 @@ namespace OneStore.Purchasing } } + /// + /// Processes the result of a purchase query and updates the inventory accordingly. + /// + /// The type of product being queried. + /// The result of the IAP request from the ONE store SDK. + /// The list of purchases retrieved from the query. + /// + /// - Resets `_productInPurchaseFlow` to `null` after processing the query. + /// - Parses the IAP result using `IapHelper.ParseJavaIapResult(javaIapResult)`. + /// - If the query fails, logs a warning, sets the query status to `Failed`, and triggers the `OnPurchaseFailed` callback. + /// - If the query is successful, updates `_queryPurchasesCallStatus[type]` to `Succeed`. + /// - Retrieves the purchase list using `IapHelper.ParseJavaPurchasesList(javaPurchasesList)`. + /// - Updates the inventory with the retrieved purchases using `_inventory.UpdatePurchaseInventory()`. + /// - Invokes the `OnPurchaseSucceeded` callback with the purchase list. + /// private void ProcessQueryPurchasesResult(ProductType type, AndroidJavaObject javaIapResult, AndroidJavaObject javaPurchasesList) { _productInPurchaseFlow = null; - var iapResult = _iapHelper.ParseJavaIapResult(javaIapResult); + var iapResult = IapHelper.ParseJavaIapResult(javaIapResult); if (!iapResult.IsSuccessful()) { - _logger.Warning("Purchase failed with error code '{0}' and message: '{1}'", + Logger.Warning("Purchase failed with error code '{0}' and message: '{1}'", iapResult.Code, iapResult.Message); _queryPurchasesCallStatus[type] = AsyncRequestStatus.Failed; @@ -553,17 +777,29 @@ namespace OneStore.Purchasing } _queryPurchasesCallStatus[type] = AsyncRequestStatus.Succeed; - var purchasesList = _iapHelper.ParseJavaPurchasesList(javaPurchasesList); + var purchasesList = IapHelper.ParseJavaPurchasesList(javaPurchasesList); _inventory.UpdatePurchaseInventory(purchasesList); RunOnMainThread(() => _callback.OnPurchaseSucceeded(purchasesList.ToList())); } + /// + /// Processes the result of a consume purchase request and updates the inventory accordingly. + /// + /// The result of the IAP request from the ONE store SDK. + /// The purchase data of the consumed product. + /// + /// - Parses the IAP result using `IapHelper.ParseJavaIapResult(javaIapResult)`. + /// - If the consumption request fails, logs an error, handles the error code, and triggers the `OnConsumeFailed` callback. + /// - If successful, parses the consumed purchase data using `IapHelper.ParseJavaPurchaseData(javaPurchaseData)`. + /// - Removes the consumed product from the inventory using `_inventory.RemovePurchase(purchaseData.ProductId)`. + /// - Invokes the `OnConsumeSucceeded` callback with the consumed purchase data. + /// private void ProcessConsumePurchaseResult(AndroidJavaObject javaIapResult, AndroidJavaObject javaPurchaseData) { - var iapResult = _iapHelper.ParseJavaIapResult(javaIapResult); + var iapResult = IapHelper.ParseJavaIapResult(javaIapResult); if (!iapResult.IsSuccessful()) { - _logger.Error("Failed to finish the consume purchase with error code {0} and message: {1}", + Logger.Error("Failed to finish the consume purchase with error code {0} and message: {1}", iapResult.Code, iapResult.Message); HandleErrorCode(iapResult, () => { @@ -572,17 +808,30 @@ namespace OneStore.Purchasing return; } - var purchaseData = _iapHelper.ParseJavaPurchaseData(javaPurchaseData); + var purchaseData = IapHelper.ParseJavaPurchaseData(javaPurchaseData); _inventory.RemovePurchase(purchaseData.ProductId); RunOnMainThread(() => _callback.OnConsumeSucceeded(purchaseData)); } + /// + /// Processes the result of an acknowledge purchase request and verifies the updated purchase status. + /// + /// The result of the IAP request from the ONE store SDK. + /// The product ID of the acknowledged purchase. + /// The type of product being acknowledged. + /// + /// - Parses the IAP result using `IapHelper.ParseJavaIapResult(javaIapResult)`. + /// - If the acknowledgment request fails, logs an error, handles the error code, and triggers the `OnAcknowledgeFailed` callback. + /// - If successful, calls `QueryPurchasesInternal()` to verify the purchase status. + /// - Runs the result on the main thread and invokes `OnAcknowledgeSucceeded` if the query is successful. + /// - If the query fails, invokes the `OnAcknowledgeFailed` callback. + /// private void ProcessAcknowledgePurchaseResult(AndroidJavaObject javaIapResult, string productId, ProductType type) { - var iapResult = _iapHelper.ParseJavaIapResult(javaIapResult); + var iapResult = IapHelper.ParseJavaIapResult(javaIapResult); if (!iapResult.IsSuccessful()) { - _logger.Error("Failed to finish the acknowledge purchase with error code {0} and message: {1}", + Logger.Error("Failed to finish the acknowledge purchase with error code {0} and message: {1}", iapResult.Code, iapResult.Message); HandleErrorCode(iapResult, () => { @@ -605,12 +854,24 @@ namespace OneStore.Purchasing }); } + /// + /// Processes the result of a recurring product management request and verifies the updated purchase status. + /// + /// The result of the IAP request from the ONE store SDK. + /// The product ID of the recurring product being managed. + /// The recurring action performed (e.g., cancel, pause, resume). + /// + /// - Parses the IAP result using `IapHelper.ParseJavaIapResult(javaIapResult)`. + /// - If the request fails, logs an error, handles the error code, and triggers the `OnManageRecurringProduct` callback with a failure response. + /// - If successful, calls `QueryPurchasesInternal()` to verify the updated purchase status. + /// - Runs the result on the main thread and invokes `OnManageRecurringProduct` with the retrieved purchase data. + /// private void ProcessRecurringProductResult(AndroidJavaObject javaIapResult, string productId, string recurringAction) { - var iapResult = _iapHelper.ParseJavaIapResult(javaIapResult); + var iapResult = IapHelper.ParseJavaIapResult(javaIapResult); if (!iapResult.IsSuccessful()) { - _logger.Error("Failed to finish the manage recurring with error code {0} and message: {1}", + Logger.Error("Failed to finish the manage recurring with error code {0} and message: {1}", iapResult.Code, iapResult.Message); HandleErrorCode(iapResult, () => { @@ -624,14 +885,33 @@ namespace OneStore.Purchasing }); } + /// + /// Internally queries the latest purchase status after an `AcknowledgePurchase()` or `ManageRecurringProduct()` API call, + /// ensuring that the product's state is updated accordingly by refreshing the inventory. + /// + /// The ID of the product to query. + /// The type of product being queried. + /// The callback function to return the query result and purchase data. + /// + /// - This function is called internally after an `AcknowledgePurchase()` or `ManageRecurringProduct()` API call + /// to refresh the product's state based on the latest purchase information. + /// - It executes `queryPurchasesAsync` internally to update the inventory with the latest state values. + /// - Creates a `QueryPurchasesListener` instance to listen for purchase query responses. + /// - Parses the IAP result using `IapHelper.ParseJavaIapResult(javaIapResult)`. + /// - If the query fails, logs a warning, handles the error code, and invokes the callback with a failure response. + /// - If the query succeeds, retrieves and parses the purchase list using `IapHelper.ParseJavaPurchasesList(javaPurchasesList)`. + /// - Updates `_inventory` with the retrieved purchases to maintain the latest product state. + /// - If a purchase matching `productId` exists in `_inventory`, invokes the callback with the corresponding `PurchaseData`. + /// - Calls `_purchaseClient.Call()` to execute the purchase query asynchronously for the specified product type. + /// private void QueryPurchasesInternal(string productId, ProductType type, Action callback) { var queryPurchasesListener = new QueryPurchasesListener(type); queryPurchasesListener.OnPurchasesResponse += (_, javaIapResult, javaPurchasesList) => { - var iapResult = _iapHelper.ParseJavaIapResult(javaIapResult); + var iapResult = IapHelper.ParseJavaIapResult(javaIapResult); if (!iapResult.IsSuccessful()) { - _logger.Warning("QueryPurchasesInternal failed with error code '{0}' and message: '{1}'", + Logger.Warning("QueryPurchasesInternal failed with error code '{0}' and message: '{1}'", iapResult.Code, iapResult.Message); HandleErrorCode(iapResult, () => { @@ -640,7 +920,7 @@ namespace OneStore.Purchasing return; } - var purchasesList = _iapHelper.ParseJavaPurchasesList(javaPurchasesList); + var purchasesList = IapHelper.ParseJavaPurchasesList(javaPurchasesList); if (purchasesList.Any()) { _inventory.UpdatePurchaseInventory(purchasesList); @@ -659,9 +939,21 @@ namespace OneStore.Purchasing ); } + /// + /// Handles specific IAP error codes and executes the appropriate response. + /// + /// The IAP result containing the error code. + /// An optional action to execute if the error code does not require a special response. + /// + /// - Retrieves the response code from the IAP result using `IapHelper.GetResponseCodeFromIapResult(iapResult)`. + /// - If the response code is `RESULT_NEED_UPDATE`, triggers the `OnNeedUpdate` callback to prompt the user to update the ONE store service. + /// - If the response code is `RESULT_NEED_LOGIN`, triggers the `OnNeedLogin` callback to prompt the user to log in. + /// - If the response code is `ERROR_SERVICE_DISCONNECTED`, resets `_productInPurchaseFlow` and updates `_connectionStatus` to `DISCONNECTED`. + /// - If none of the above cases match, the provided `action` (if any) is executed. + /// private void HandleErrorCode(IapResult iapResult, Action action = null) { - var responseCode = _iapHelper.GetResponseCodeFromIapResult(iapResult); + var responseCode = IapHelper.GetResponseCodeFromIapResult(iapResult); switch (responseCode) { case ResponseCode.RESULT_NEED_UPDATE: @@ -680,6 +972,14 @@ namespace OneStore.Purchasing } } + /// + /// Executes the specified action on the main thread using the ONE store dispatcher. + /// + /// The action to execute on the main thread. + /// + /// - Calls `OneStoreDispatcher.RunOnMainThread()` to ensure that the provided action runs on the main UI thread. + /// - This is useful for updating UI elements or triggering callbacks that require execution on the main thread. + /// private void RunOnMainThread(Action action) { OneStoreDispatcher.RunOnMainThread(() => action()); diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseClientImpl.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseClientImpl.cs.meta index 6379389..7629493 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseClientImpl.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseClientImpl.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 83bea0b014e634756af66f3a340f9ed8 +guid: a428fd88042f746e8a7b125eea2b255c MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseData.cs b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseData.cs index 0c3658e..ff63416 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseData.cs +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseData.cs @@ -1,6 +1,7 @@ using System; using UnityEngine; using OneStore.Purchasing.Internal; +using Logger = OneStore.Common.OneStoreLogger; namespace OneStore.Purchasing { @@ -29,6 +30,7 @@ namespace OneStore.Purchasing public long PurchaseTime { get { return _purchaseMeta.purchaseTime; } } + [Obsolete] public string PurchaseId { get { return _purchaseMeta.purchaseId; } } public string PurchaseToken { get { return _purchaseMeta.purchaseToken; } } @@ -61,9 +63,11 @@ namespace OneStore.Purchasing purchaseData = new PurchaseData(purchaseMeta, jsonPurchaseData, signature); return true; } - catch (Exception) + catch (Exception ex) { - // Error is logged at the caller side. + Logger.Error("[PurchaseData]: Failed to parse purchase data: {0}", jsonPurchaseData); + Logger.Exception(ex); + purchaseData = null; return false; } @@ -71,7 +75,12 @@ namespace OneStore.Purchasing public AndroidJavaObject ToJava() { - return new AndroidJavaObject(Constants.PurchaseDataClass, _purchaseReceipt.json); + return new AndroidJavaObject( + Constants.PurchaseDataClass, + _purchaseReceipt.json, + _purchaseReceipt.signature, + null + ); } [Serializable] @@ -96,12 +105,12 @@ namespace OneStore.Purchasing private class PurchaseReceipt { public string json; - public string sigature; + public string signature; public PurchaseReceipt(string jsonPurchaseData, string signature) { json = jsonPurchaseData; - this.sigature = signature; + this.signature = signature; } } } diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseData.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseData.cs.meta index 041ef5b..579bd03 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseData.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseData.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 32d816303781743ebbef5fd546e63d01 +guid: c0c9deb7e41a54ff9a7af2666ad1f463 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseFlowParams.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseFlowParams.cs.meta index 4e44a7b..30d1134 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseFlowParams.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseFlowParams.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: a28e0eadc8ecc49d1a29b4b0ae1e942a +guid: 92dd96d95eedf4f149d2f39a1b4b0748 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseState.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseState.cs.meta index ba1501f..438af46 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseState.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/PurchaseState.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: fb3ca9121fecd400388c947a7a42b506 +guid: 8d580cce6b60743eabfc1ecb92344eeb MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/RecurringAction.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/RecurringAction.cs.meta index fed7adb..af8aef7 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/RecurringAction.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/RecurringAction.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5e633c651f515454982c361256daeee1 +guid: 93672977f18284c1fa4049aac597106e MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/RecurringState.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/RecurringState.cs.meta index 718d222..ad4a7c6 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/RecurringState.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/RecurringState.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: f03f991946ce3434a8d1e5276d57ce1f +guid: 2a2082820f96e4501b58f79e46c7d833 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ResponseCode.cs.meta b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ResponseCode.cs.meta index 823e487..c556b09 100644 --- a/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ResponseCode.cs.meta +++ b/Assets/OneStoreCorpPlugins/Purchase/Runtime/Scripts/ResponseCode.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 250c5f20f9942467a97302fe303393fc +guid: 67a60a955ccf04bff94e949b51953420 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/OneStoreCorpPlugins/README.md b/Assets/OneStoreCorpPlugins/README.md index c841dae..29e4fd7 100644 --- a/Assets/OneStoreCorpPlugins/README.md +++ b/Assets/OneStoreCorpPlugins/README.md @@ -2,7 +2,7 @@ ## Overview -ONE store **In-App Integration Library *v1.2.0*** is a service that sells and charges products implemented in Android apps to users using ONE store's authentication and payment system, and settles them with the developers. +ONE store **In-App Integration Library *v1.3.2*** is a service that sells and charges products implemented in Android apps to users using ONE store's authentication and payment system, and settles them with the developers. In order to pay for in-app products, it must be linked with the ONE store service (OSS) app, and the OSS app works with the ONE store payment server to conduct payments for in-app products. @@ -10,8 +10,29 @@ In order to pay for in-app products, it must be linked with the ONE store servic These are required libraries for using in-app purchases or check licenses. -* OneStoreCorpPlugins/Common -* OneStoreCorpPlugins/Authentication +* Assets/OneStoreCorpPlugins/Common +* Assets/OneStoreCorpPlugins/Authentication + +## Do you use a proguard? + +**It's already obfuscated and in aar, so add the package to the proguard rules.** + +```text +# Core proGuard rules +-keep class com.gaa.sdk.base.** { *; } +-keep class com.gaa.sdk.auth.** { *; } + +# Purchasing proGuard rules +-keep class com.gaa.sdk.iap.** { *; } + +# Licensing proGuard rules +-keep class com.onestore.extern.licensing.** { *; } +``` + +## Include external dependencies + +The In-app integration Unity Library is distributed with the [EDM4U(External Dependency Manager for Unity)](https://github.com/googlesamples/unity-jar-resolver). +This library is intended for use by any Unity plugin that requires access to Android-specific libraries. It provides Unity plugins the ability to declare dependencies, which are then automatically resolved and copied into your Unity project. ## How do I use In-app module? @@ -43,7 +64,7 @@ var purchaseClient = new PurchaseClientImpl(licenseKey); purchaseClient.Initialize(callback); ``` -Refer to the [IAP documentation](https://onestore-dev.gitbook.io/dev/tools/tools/v21/12.-unity-sdk-v21#id-12.unity-sdkv21-14) for more information. +Refer to the [IAP documentation](https://onestore-dev.gitbook.io/dev/eng/tools/tools/v21/unity) for more information. ### Licensing module @@ -60,7 +81,7 @@ var licenseChecker = new OneStoreAppLicenseCheckerImpl(licenseKey); licenseChecker.Initialize(callback); ``` -Refer to the [ALC documentation](https://onestore-dev.gitbook.io/dev/tools/tools/alc/unity-alc-sdk-v2-1) for more information. +Refer to the [ALC documentation](https://onestore-dev.gitbook.io/dev/eng/tools/alc/using-alc-sdk-v2-in-unity) for more information. # License diff --git a/Assets/OneStoreCorpPlugins/README.md.meta b/Assets/OneStoreCorpPlugins/README.md.meta index 0a8e940..0d43f74 100644 --- a/Assets/OneStoreCorpPlugins/README.md.meta +++ b/Assets/OneStoreCorpPlugins/README.md.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: aad8ecf947f4e4730902603a226ecd71 +guid: 5d0dfe59deb704029ae2bed12535b59d TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/Android/AndroidManifest.xml b/Assets/Plugins/Android/AndroidManifest.xml index 2afb411..0b33991 100644 --- a/Assets/Plugins/Android/AndroidManifest.xml +++ b/Assets/Plugins/Android/AndroidManifest.xml @@ -1,27 +1,42 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Assets/Plugins/Android/AndroidManifest.xml.meta b/Assets/Plugins/Android/AndroidManifest.xml.meta index 65ba068..a18c6f6 100644 --- a/Assets/Plugins/Android/AndroidManifest.xml.meta +++ b/Assets/Plugins/Android/AndroidManifest.xml.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 60e0dd7c853d7674ca23627bf268466b +guid: 4d8a3cea4ebb8498c87ff92db8a3aa24 TextScriptImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/Android/mainTemplate.gradle b/Assets/Plugins/Android/mainTemplate.gradle index c0b6778..e95bcb2 100644 --- a/Assets/Plugins/Android/mainTemplate.gradle +++ b/Assets/Plugins/Android/mainTemplate.gradle @@ -13,8 +13,8 @@ dependencies { implementation 'com.google.android.ump:user-messaging-platform:3.1.0' // Packages/com.google.ads.mobile/GoogleMobileAds/Editor/GoogleUmpDependencies.xml:7 implementation 'com.google.games:gpgs-plugin-support:2.1.0' // Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11 implementation 'com.google.signin:google-signin-support:1.0.4' // Assets/GoogleSignIn/Editor/GoogleSignInSupportDependencies.xml:9 - implementation 'com.onestorecorp.sdk:sdk-iap:21.01.00' // Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml:6 - implementation 'com.onestorecorp.sdk:sdk-licensing:2.1.0' // Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml:6 + implementation 'com.onestorecorp.sdk:sdk-iap:21.02.01' // Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml:6 + implementation 'com.onestorecorp.sdk:sdk-licensing:2.2.1' // Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml:6 implementation 'com.unity3d.ads:unity-ads:4.12.3' // Assets/GoogleMobileAds/Mediation/UnityAds/Editor/UnityMediationDependencies.xml:33 // Android Resolver Dependencies End **DEPS**} @@ -23,15 +23,21 @@ dependencies { android { namespace "com.unity3d.player" ndkVersion "**NDKVERSION**" - packaging { - exclude ('/lib/armeabi/*' + '*') - exclude ('/lib/mips/*' + '*') - exclude ('/lib/mips64/*' + '*') - exclude ('/lib/x86/*' + '*') - exclude ('/lib/x86_64/*' + '*') - } + + packaging { + jniLibs { + excludes += [ + "/lib/armeabi/*", + "/lib/mips/*", + "/lib/mips64/*", + "/lib/x86/*", + "/lib/x86_64/*" + ] + } + } } // Android Resolver Exclusions End + android { ndkPath "**NDKPATH**" @@ -64,6 +70,7 @@ android { ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~" }**PACKAGING** } + **IL_CPP_BUILD_SETUP** **SOURCE_BUILD_SETUP** -**EXTERNAL_SOURCES** +**EXTERNAL_SOURCES** \ No newline at end of file diff --git a/Assets/Plugins/Android/mainTemplate.gradle.backup b/Assets/Plugins/Android/mainTemplate.gradle.backup index d725bc1..cf73b55 100644 --- a/Assets/Plugins/Android/mainTemplate.gradle.backup +++ b/Assets/Plugins/Android/mainTemplate.gradle.backup @@ -1,4 +1,5 @@ apply plugin: 'com.android.library' +apply from: '../shared/keepUnitySymbols.gradle' **APPLY_PLUGINS** dependencies { @@ -9,21 +10,11 @@ dependencies { implementation 'com.google.ads.mediation:unity:4.12.3.0' // Assets/GoogleMobileAds/Mediation/UnityAds/Editor/UnityMediationDependencies.xml:25 implementation 'com.google.android.gms:play-services-ads:23.6.0' // Packages/com.google.ads.mobile/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:7 implementation 'com.google.android.gms:play-services-auth:16+' // Assets/GoogleSignIn/Editor/GoogleSignInDependencies.xml:10 - implementation 'com.google.android.gms:play-services-base:18.5.0' // Assets/Firebase/Editor/DatabaseDependencies.xml:17 implementation 'com.google.android.ump:user-messaging-platform:3.1.0' // Packages/com.google.ads.mobile/GoogleMobileAds/Editor/GoogleUmpDependencies.xml:7 - implementation 'com.google.firebase:firebase-analytics:22.0.2' // Assets/Firebase/Editor/DatabaseDependencies.xml:15 - implementation 'com.google.firebase:firebase-analytics-unity:12.2.1' // Assets/Firebase/Editor/AnalyticsDependencies.xml:18 - implementation 'com.google.firebase:firebase-app-unity:12.2.1' // Assets/Firebase/Editor/AppDependencies.xml:22 - implementation 'com.google.firebase:firebase-auth:23.0.0' // Assets/Firebase/Editor/AuthDependencies.xml:13 - implementation 'com.google.firebase:firebase-auth-unity:12.2.1' // Assets/Firebase/Editor/AuthDependencies.xml:20 - implementation 'com.google.firebase:firebase-common:21.0.0' // Assets/Firebase/Editor/AppDependencies.xml:13 - implementation 'com.google.firebase:firebase-crashlytics-ndk:19.0.3' // Assets/Firebase/Editor/CrashlyticsDependencies.xml:13 - implementation 'com.google.firebase:firebase-crashlytics-unity:12.2.1' // Assets/Firebase/Editor/CrashlyticsDependencies.xml:20 - implementation 'com.google.firebase:firebase-database:21.0.0' // Assets/Firebase/Editor/DatabaseDependencies.xml:13 - implementation 'com.google.firebase:firebase-database-unity:12.2.1' // Assets/Firebase/Editor/DatabaseDependencies.xml:22 + implementation 'com.google.games:gpgs-plugin-support:2.1.0' // Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11 implementation 'com.google.signin:google-signin-support:1.0.4' // Assets/GoogleSignIn/Editor/GoogleSignInSupportDependencies.xml:9 - implementation 'com.onestorecorp.sdk:sdk-iap:21.01.00' // Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml:6 - implementation 'com.onestorecorp.sdk:sdk-licensing:2.1.0' // Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml:6 + implementation 'com.onestorecorp.sdk:sdk-iap:21.02.01' // Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml:6 + implementation 'com.onestorecorp.sdk:sdk-licensing:2.2.1' // Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml:6 implementation 'com.unity3d.ads:unity-ads:4.12.3' // Assets/GoogleMobileAds/Mediation/UnityAds/Editor/UnityMediationDependencies.xml:33 // Android Resolver Dependencies End **DEPS**} @@ -42,7 +33,7 @@ android { android { ndkPath "**NDKPATH**" - compileSdkVersion **APIVERSION** + compileSdk **APIVERSION** buildToolsVersion '**BUILDTOOLS**' compileOptions { @@ -51,9 +42,10 @@ android { } defaultConfig { - minSdkVersion **MINSDKVERSION** - targetSdkVersion **TARGETSDKVERSION** + minSdk **MINSDK** + targetSdk **TARGETSDK** ndk { + debugSymbolLevel **DEBUGSYMBOLLEVEL** abiFilters **ABIFILTERS** } versionCode **VERSIONCODE** @@ -61,14 +53,14 @@ android { consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD** } - lintOptions { + lint { abortOnError false } - aaptOptions { + androidResources { noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ') ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~" - }**PACKAGING_OPTIONS** + }**PACKAGING** } **IL_CPP_BUILD_SETUP** **SOURCE_BUILD_SETUP** diff --git a/Assets/Plugins/Android/mainTemplate.gradle.backup.meta b/Assets/Plugins/Android/mainTemplate.gradle.backup.meta index 6d1326a..f708819 100644 --- a/Assets/Plugins/Android/mainTemplate.gradle.backup.meta +++ b/Assets/Plugins/Android/mainTemplate.gradle.backup.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4ce20a111238ed94b97bb345cc0c7231 +guid: 8317a3ae2111acd489fec93e5f988816 DefaultImporter: externalObjects: {} userData: diff --git a/Assets/Plugins/Android/mainTemplate.gradle.backup2 b/Assets/Plugins/Android/mainTemplate.gradle.backup2 deleted file mode 100644 index 49de2f5..0000000 --- a/Assets/Plugins/Android/mainTemplate.gradle.backup2 +++ /dev/null @@ -1,66 +0,0 @@ -apply plugin: 'com.android.library' -apply from: '../shared/keepUnitySymbols.gradle' -**APPLY_PLUGINS** - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) -// Android Resolver Dependencies Start - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' // Packages/com.google.ads.mobile/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:12 - implementation 'com.google.ads.mediation:facebook:6.18.0.0' // Packages/com.google.ads.mobile.mediation.metaaudiencenetwork/source/plugin/Assets/GoogleMobileAds/Mediation/MetaAudienceNetwork/Editor/MetaAudienceNetworkMediationDependencies.xml:24 - implementation 'com.google.ads.mediation:unity:4.12.3.0' // Assets/GoogleMobileAds/Mediation/UnityAds/Editor/UnityMediationDependencies.xml:25 - implementation 'com.google.android.gms:play-services-ads:23.6.0' // Packages/com.google.ads.mobile/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:7 - implementation 'com.google.android.gms:play-services-auth:16+' // Assets/GoogleSignIn/Editor/GoogleSignInDependencies.xml:10 - implementation 'com.google.android.ump:user-messaging-platform:3.1.0' // Packages/com.google.ads.mobile/GoogleMobileAds/Editor/GoogleUmpDependencies.xml:7 - implementation 'com.google.signin:google-signin-support:1.0.4' // Assets/GoogleSignIn/Editor/GoogleSignInSupportDependencies.xml:9 - implementation 'com.onestorecorp.sdk:sdk-iap:21.01.00' // Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml:6 - implementation 'com.onestorecorp.sdk:sdk-licensing:2.1.0' // Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml:6 - implementation 'com.unity3d.ads:unity-ads:4.12.3' // Assets/GoogleMobileAds/Mediation/UnityAds/Editor/UnityMediationDependencies.xml:33 -// Android Resolver Dependencies End -**DEPS**} - -// Android Resolver Exclusions Start -android { - packagingOptions { - exclude ('/lib/armeabi/*' + '*') - exclude ('/lib/mips/*' + '*') - exclude ('/lib/mips64/*' + '*') - exclude ('/lib/x86/*' + '*') - exclude ('/lib/x86_64/*' + '*') - } -} -// Android Resolver Exclusions End -android { - ndkPath "**NDKPATH**" - - compileSdk **APIVERSION** - buildToolsVersion '**BUILDTOOLS**' - - compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 - } - - defaultConfig { - minSdk **MINSDK** - targetSdk **TARGETSDK** - ndk { - debugSymbolLevel **DEBUGSYMBOLLEVEL** - abiFilters **ABIFILTERS** - } - versionCode **VERSIONCODE** - versionName '**VERSIONNAME**' - consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD** - } - - lint { - abortOnError false - } - - androidResources { - noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ') - ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~" - }**PACKAGING** -} -**IL_CPP_BUILD_SETUP** -**SOURCE_BUILD_SETUP** -**EXTERNAL_SOURCES** diff --git a/Assets/Plugins/Android/mainTemplate.gradle.backup2.meta b/Assets/Plugins/Android/mainTemplate.gradle.backup2.meta deleted file mode 100644 index 9a61b04..0000000 --- a/Assets/Plugins/Android/mainTemplate.gradle.backup2.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 3cf0d92cbbc9dbb429aec363311f53cf -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Plugins/Android/mainTemplate.gradle.backup3 b/Assets/Plugins/Android/mainTemplate.gradle.backup3 deleted file mode 100644 index c08644e..0000000 --- a/Assets/Plugins/Android/mainTemplate.gradle.backup3 +++ /dev/null @@ -1,67 +0,0 @@ -apply plugin: 'com.android.library' -apply from: '../shared/keepUnitySymbols.gradle' -**APPLY_PLUGINS** - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) -// Android Resolver Dependencies Start - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' // Packages/com.google.ads.mobile/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:12 - implementation 'com.google.ads.mediation:facebook:6.18.0.0' // Packages/com.google.ads.mobile.mediation.metaaudiencenetwork/source/plugin/Assets/GoogleMobileAds/Mediation/MetaAudienceNetwork/Editor/MetaAudienceNetworkMediationDependencies.xml:24 - implementation 'com.google.ads.mediation:unity:4.12.3.0' // Assets/GoogleMobileAds/Mediation/UnityAds/Editor/UnityMediationDependencies.xml:25 - implementation 'com.google.android.gms:play-services-ads:23.6.0' // Packages/com.google.ads.mobile/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:7 - implementation 'com.google.android.gms:play-services-auth:16+' // Assets/GoogleSignIn/Editor/GoogleSignInDependencies.xml:10 - implementation 'com.google.android.ump:user-messaging-platform:3.1.0' // Packages/com.google.ads.mobile/GoogleMobileAds/Editor/GoogleUmpDependencies.xml:7 - implementation 'com.google.games:gpgs-plugin-support:2.1.0' // Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml:11 - implementation 'com.google.signin:google-signin-support:1.0.4' // Assets/GoogleSignIn/Editor/GoogleSignInSupportDependencies.xml:9 - implementation 'com.onestorecorp.sdk:sdk-iap:21.01.00' // Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml:6 - implementation 'com.onestorecorp.sdk:sdk-licensing:2.1.0' // Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml:6 - implementation 'com.unity3d.ads:unity-ads:4.12.3' // Assets/GoogleMobileAds/Mediation/UnityAds/Editor/UnityMediationDependencies.xml:33 -// Android Resolver Dependencies End -**DEPS**} - -// Android Resolver Exclusions Start -android { - packagingOptions { - exclude ('/lib/armeabi/*' + '*') - exclude ('/lib/mips/*' + '*') - exclude ('/lib/mips64/*' + '*') - exclude ('/lib/x86/*' + '*') - exclude ('/lib/x86_64/*' + '*') - } -} -// Android Resolver Exclusions End -android { - ndkPath "**NDKPATH**" - - compileSdk **APIVERSION** - buildToolsVersion '**BUILDTOOLS**' - - compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 - } - - defaultConfig { - minSdk **MINSDK** - targetSdk **TARGETSDK** - ndk { - debugSymbolLevel **DEBUGSYMBOLLEVEL** - abiFilters **ABIFILTERS** - } - versionCode **VERSIONCODE** - versionName '**VERSIONNAME**' - consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD** - } - - lint { - abortOnError false - } - - androidResources { - noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ') - ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~" - }**PACKAGING** -} -**IL_CPP_BUILD_SETUP** -**SOURCE_BUILD_SETUP** -**EXTERNAL_SOURCES** diff --git a/Assets/Plugins/Android/settingsTemplate.gradle b/Assets/Plugins/Android/settingsTemplate.gradle index 7ec1441..6190297 100644 --- a/Assets/Plugins/Android/settingsTemplate.gradle +++ b/Assets/Plugins/Android/settingsTemplate.gradle @@ -19,7 +19,7 @@ dependencyResolutionManagement { // Android Resolver Repos Start def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/") maven { - url "https://repo.onestore.co.kr/repository/onestore-sdk-public" // Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml:5, Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml:5 + url "https://repo.onestore.net/repository/onestore-sdk-public" // Assets/OneStoreCorpPlugins/AppLicenseChecker/Editor/AppLicenseCheckerDependencies.xml:5, Assets/OneStoreCorpPlugins/Purchase/Editor/PurchaseDependencies.xml:5 } maven { url "https://repo.maven.apache.org/maven2/" // Assets/GoogleMobileAds/Mediation/UnityAds/Editor/UnityMediationDependencies.xml:25, Assets/GoogleMobileAds/Mediation/UnityAds/Editor/UnityMediationDependencies.xml:33, Packages/com.google.ads.mobile.mediation.metaaudiencenetwork/source/plugin/Assets/GoogleMobileAds/Mediation/MetaAudienceNetwork/Editor/MetaAudienceNetworkMediationDependencies.xml:24 diff --git a/Assets/Resources/Prefabs/Popups/SuccessIAPPopup.prefab b/Assets/Resources/Prefabs/Popups/SuccessIAPPopup.prefab new file mode 100644 index 0000000..f3921a6 --- /dev/null +++ b/Assets/Resources/Prefabs/Popups/SuccessIAPPopup.prefab @@ -0,0 +1,922 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &390802407618204545 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8972982524553282657} + - component: {fileID: 5298151295405292898} + - component: {fileID: 549864252730385478} + - component: {fileID: 2113219614763370414} + m_Layer: 5 + m_Name: CloseButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8972982524553282657 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 390802407618204545} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1042989346100584862} + m_Father: {fileID: 4135250823162303292} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: -170} + m_SizeDelta: {x: 350, y: 120} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &5298151295405292898 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 390802407618204545} + m_CullTransparentMesh: 1 +--- !u!114 &549864252730385478 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 390802407618204545} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 1c01f2ab08fa29249b1abe0a7243c0c0, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 2 +--- !u!114 &2113219614763370414 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 390802407618204545} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 14a02640485dabf4d8eeab6b8d0e1f37, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Delegates: + - eventID: 4 + callback: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 2911370836823128795} + m_TargetAssemblyTypeName: ClosePopup, Assembly-CSharp + m_MethodName: ClickClose + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!1 &397412108091851723 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8000226063380716136} + - component: {fileID: 3213857974357519311} + - component: {fileID: 1398040885298130073} + - component: {fileID: 5658399553391778534} + - component: {fileID: 2911370836823128795} + m_Layer: 5 + m_Name: SuccessIAPPopup + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8000226063380716136 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 397412108091851723} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4135250823162303292} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3213857974357519311 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 397412108091851723} + m_CullTransparentMesh: 1 +--- !u!223 &1398040885298130073 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 397412108091851723} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &5658399553391778534 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 397412108091851723} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &2911370836823128795 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 397412108091851723} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0c4ddf2e49606d74c8ac073053cc1203, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &991253874521515030 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3047485038091578251} + - component: {fileID: 8188767992777897516} + - component: {fileID: 76754462115906588} + m_Layer: 5 + m_Name: New TMP + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3047485038091578251 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 991253874521515030} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8496956424309632509} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 12, y: 0} + m_SizeDelta: {x: 200, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8188767992777897516 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 991253874521515030} + m_CullTransparentMesh: 1 +--- !u!114 &76754462115906588 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 991253874521515030} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\uC54C\uB9BC" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: cf1ae75e65a967946b23286a5ffbb812, type: 2} + m_sharedMaterial: {fileID: 2100000, guid: 1cd9f54883d04fa4a8273aaf06ef64e9, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 45 + m_fontSizeBase: 45 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 4096 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 0 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 0 + m_ActiveFontFeatures: 6e72656b + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &2154139544037527918 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1042989346100584862} + - component: {fileID: 8309988824058465323} + - component: {fileID: 7804275797110217787} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1042989346100584862 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2154139544037527918} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8972982524553282657} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 5} + m_SizeDelta: {x: 0, y: -10} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8309988824058465323 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2154139544037527918} + m_CullTransparentMesh: 1 +--- !u!114 &7804275797110217787 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2154139544037527918} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\uB2EB\uAE30\n" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: cf1ae75e65a967946b23286a5ffbb812, type: 2} + m_sharedMaterial: {fileID: 2100000, guid: 1cd9f54883d04fa4a8273aaf06ef64e9, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 45 + m_fontSizeBase: 45 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 0 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 0 + m_ActiveFontFeatures: + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 0 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 0 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 0 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &3863971523126810887 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 316095147889220357} + - component: {fileID: 8418049679370288873} + - component: {fileID: 4283892075569996861} + m_Layer: 5 + m_Name: New Image + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &316095147889220357 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3863971523126810887} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4135250823162303292} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: -128, y: 144} + m_SizeDelta: {x: 256, y: 256} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8418049679370288873 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3863971523126810887} + m_CullTransparentMesh: 1 +--- !u!114 &4283892075569996861 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3863971523126810887} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 26c271bb3b7a45f478e3cd30098969a4, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &3889591197461841061 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4135250823162303292} + - component: {fileID: 3635546156470382896} + - component: {fileID: 527290543126384337} + m_Layer: 5 + m_Name: Box + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4135250823162303292 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3889591197461841061} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8496956424309632509} + - {fileID: 2195634732034470274} + - {fileID: 8972982524553282657} + - {fileID: 316095147889220357} + m_Father: {fileID: 8000226063380716136} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 72} + m_SizeDelta: {x: 900, y: 600} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3635546156470382896 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3889591197461841061} + m_CullTransparentMesh: 1 +--- !u!114 &527290543126384337 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3889591197461841061} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 5f7fd8185eb11854b9a83301264d3454, type: 3} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &4050406883744328128 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2195634732034470274} + - component: {fileID: 8408998210073545390} + - component: {fileID: 7007841048313894726} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2195634732034470274 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4050406883744328128} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4135250823162303292} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 50} + m_SizeDelta: {x: 200, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &8408998210073545390 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4050406883744328128} + m_CullTransparentMesh: 1 +--- !u!114 &7007841048313894726 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4050406883744328128} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 0 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\uC544\uC774\uD15C\uC744 \uAD6C\uB9E4\uD558\uC600\uC2B5\uB2C8\uB2E4." + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: cf1ae75e65a967946b23286a5ffbb812, type: 2} + m_sharedMaterial: {fileID: -6508382273668546854, guid: cf1ae75e65a967946b23286a5ffbb812, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4278190080 + m_fontColor: {r: 0, g: 0, b: 0, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 50 + m_fontSizeBase: 50 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 0 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 0 + m_ActiveFontFeatures: + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 0 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 0 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 0 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &5598953518082891559 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8188211741039335737} + - component: {fileID: 6693613479061092706} + - component: {fileID: 5767840059071212560} + m_Layer: 5 + m_Name: Icon + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8188211741039335737 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5598953518082891559} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8496956424309632509} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 32, y: 0} + m_SizeDelta: {x: 64, y: 64} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6693613479061092706 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5598953518082891559} + m_CullTransparentMesh: 1 +--- !u!114 &5767840059071212560 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5598953518082891559} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 69a68706eacc7334b9a770b896fbc76b, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &7474380692331536075 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8496956424309632509} + - component: {fileID: 7732888152171209898} + - component: {fileID: 7656006409484180731} + m_Layer: 5 + m_Name: Alim + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8496956424309632509 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7474380692331536075} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8188211741039335737} + - {fileID: 3047485038091578251} + m_Father: {fileID: 4135250823162303292} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 114, y: -14} + m_SizeDelta: {x: 300, y: 67} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &7732888152171209898 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7474380692331536075} + m_CullTransparentMesh: 1 +--- !u!114 &7656006409484180731 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7474380692331536075} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: ebd9e391ef36c374a92e070927298f85, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 diff --git a/Assets/Plugins/Android/mainTemplate.gradle.backup3.meta b/Assets/Resources/Prefabs/Popups/SuccessIAPPopup.prefab.meta similarity index 63% rename from Assets/Plugins/Android/mainTemplate.gradle.backup3.meta rename to Assets/Resources/Prefabs/Popups/SuccessIAPPopup.prefab.meta index 84e868a..5322f63 100644 --- a/Assets/Plugins/Android/mainTemplate.gradle.backup3.meta +++ b/Assets/Resources/Prefabs/Popups/SuccessIAPPopup.prefab.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 10885133b1498294eb547f60323118b9 -DefaultImporter: +guid: f71ad30646a8a934f8abe6d510df75c4 +PrefabImporter: externalObjects: {} userData: assetBundleName: diff --git a/Assets/Scripts/SingletonManagers/Managers/IAPManager.cs b/Assets/Scripts/SingletonManagers/Managers/IAPManager.cs index 273ed4f..8a6ae6f 100644 --- a/Assets/Scripts/SingletonManagers/Managers/IAPManager.cs +++ b/Assets/Scripts/SingletonManagers/Managers/IAPManager.cs @@ -1,4 +1,9 @@ -using System.Collections; +using OneStore.Auth; +using OneStore.Common; +using OneStore.Purchasing; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Text; using UnityEngine; using UnityEngine.Events; @@ -11,43 +16,65 @@ public class IAPManager : MonoBehaviour, IDetailedStoreListener private IExtensionProvider storeExtensionProvider; //여러 플랫폼을 위한 확장 처리 제공자 private StringBuilder sb = new StringBuilder(); - + public UnityAction OnProcessPurchase; public UnityAction OnProcessPurchaseFailed; private bool isInitialize = false; + private static readonly string TAG = "IAPManager"; + string[] all_products = { "com.fgb.cash500", "com.fgb.cash2000", "com.fgb.cash7500", + "com.fgb.heart20", "com.fgb.heart150", "com.fgb.heart500" }; + //private List productDetails = new List(); + //private Dictionary purchaseMap = new Dictionary(); + private Dictionary signatureMap = new Dictionary(); + string onstore_publickey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCCkywe50yx7BpLXxrkothbVVY5hyHNq/L4u0ExhMxIY7lj6yX4TZjQtWGr+gPakI28RNO8QEVMBtDxtWb1/JyMPIcqzwLqqwYhFdtUxNSkIOpZHDx8+spXotwcKG6zm5w7c8iXcHg8hnlrUArLYdNcRh/cMu+bHIAsx1BKS5rDSwIDAQAB"; + PurchaseClientImpl m_PurchaseClientImpl; + OneStoreIapCallBack m_OneStoreIapCallBack = new OneStoreIapCallBack(); + + void Start() { + Init_IAP(); + //if (GameManager.Network != null) //{ // if (GameManager.Network.IsOnline) // { - // InitUnityIAP(); //Start 문에서 초기화 필수 + // Init_IAP(); //Start 문에서 초기화 필수 // } // GameManager.Network.OnNetworkOnline += OnNetworkOnline; //} - - InitUnityIAP(); //Start 문에서 초기화 필수 } - /* Unity IAP를 초기화하는 함수 */ - private void InitUnityIAP() + private void Init_IAP() { - ConfigurationBuilder builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance()); + Debug.Log("StoreEnvironment.GetStoreType() " + StoreEnvironment.GetStoreType()); + if (StoreEnvironment.GetStoreType() == StoreType.ONESTORE) + { + m_PurchaseClientImpl = new PurchaseClientImpl(onstore_publickey); + m_PurchaseClientImpl.Initialize(m_OneStoreIapCallBack); + m_OneStoreIapCallBack.m_PurchaseClientImpl = m_PurchaseClientImpl; + m_PurchaseClientImpl.QueryProductDetails(new ReadOnlyCollection(all_products), OneStore.Purchasing.ProductType.ALL); // 상품 정보 받아오기 + m_PurchaseClientImpl.QueryPurchases(OneStore.Purchasing.ProductType.INAPP); // 미지급된 상품이 있는 지 체크 + } + else + { + ConfigurationBuilder builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance()); - /* 구글 플레이 상품들 추가 */ - //builder.AddProduct("com.fgb.adsremove", ProductType.Consumable); - builder.AddProduct("com.fgb.cash500", ProductType.Consumable); - builder.AddProduct("com.fgb.cash2000", ProductType.Consumable); - builder.AddProduct("com.fgb.cash7500", ProductType.Consumable); - builder.AddProduct("com.fgb.heart20", ProductType.Consumable); - builder.AddProduct("com.fgb.heart150", ProductType.Consumable); - builder.AddProduct("com.fgb.heart500", ProductType.Consumable); + /* 구글 플레이 상품들 추가 */ + //builder.AddProduct("com.fgb.adsremove", ProductType.Consumable); + builder.AddProduct("com.fgb.cash500", UnityEngine.Purchasing.ProductType.Consumable); + builder.AddProduct("com.fgb.cash2000", UnityEngine.Purchasing.ProductType.Consumable); + builder.AddProduct("com.fgb.cash7500", UnityEngine.Purchasing.ProductType.Consumable); + builder.AddProduct("com.fgb.heart20", UnityEngine.Purchasing.ProductType.Consumable); + builder.AddProduct("com.fgb.heart150", UnityEngine.Purchasing.ProductType.Consumable); + builder.AddProduct("com.fgb.heart500", UnityEngine.Purchasing.ProductType.Consumable); - UnityPurchasing.Initialize(this, builder); + UnityPurchasing.Initialize(this, builder); + } isInitialize = true; } @@ -55,21 +82,43 @@ public class IAPManager : MonoBehaviour, IDetailedStoreListener /* 구매하는 함수 */ public void Purchase(string productId) { - if (storeController != null) + if (StoreEnvironment.GetStoreType() == StoreType.ONESTORE) { - Product product = storeController.products.WithID(productId); //상품 정의 + ProductDetail productDetail = m_OneStoreIapCallBack.Get_ProductDetail(productId); + if (productDetail != null) + { + OneStore.Purchasing.ProductType productType = OneStore.Purchasing.ProductType.Get(productDetail.type); - if (product != null && product.availableToPurchase) //상품이 존재하면서 구매 가능하면 - { - storeController.InitiatePurchase(product); //구매가 가능하면 진행 + var purchaseFlowParams = new PurchaseFlowParams.Builder() + .SetProductId(productId) // mandatory + .SetProductType(productType) // mandatory + .Build(); + + m_PurchaseClientImpl.Purchase(purchaseFlowParams); } - else //상품이 존재하지 않거나 구매 불가능하면 - { - Debug.Log("상품이 없거나 현재 구매가 불가능합니다"); + else + { // 초기화가 안됐으니 다시 시도 + Init_IAP(); } } else - Debug.Log("인앱 초기화가 되지 않았습니다."); + { + if (storeController != null) + { + Product product = storeController.products.WithID(productId); //상품 정의 + + if (product != null && product.availableToPurchase) //상품이 존재하면서 구매 가능하면 + { + storeController.InitiatePurchase(product); //구매가 가능하면 진행 + } + else //상품이 존재하지 않거나 구매 불가능하면 + { + Debug.Log("상품이 없거나 현재 구매가 불가능합니다"); + } + } + else + Debug.Log("인앱 초기화가 되지 않았습니다."); + } } /* 초기화 성공 시 실행되는 함수 */ @@ -130,7 +179,7 @@ public class IAPManager : MonoBehaviour, IDetailedStoreListener { if(isOnline == true && isInitialize == false) { - InitUnityIAP(); + Init_IAP(); } } @@ -166,4 +215,102 @@ public class IAPManager : MonoBehaviour, IDetailedStoreListener break; } } -} + + class OneStoreIapCallBack : IPurchaseCallback + { + public Action Action_Init; + + public PurchaseClientImpl m_PurchaseClientImpl; + + List m_productDetails; + public string Get_Price(string id) + { + var detail = Get_ProductDetail(id); + return detail != null ? detail.price : ""; + } + public ProductDetail Get_ProductDetail(string id) + { + if (m_productDetails != null) + { + for (int i = 0; i < m_productDetails.Count; ++i) + { + if (m_productDetails[i].productId.Equals(id)) + return m_productDetails[i]; + } + } + return null; + } + + public void OnAcknowledgeFailed(IapResult iapResult) + { + Debug.Log("OnAcknowledgeFailed : " + iapResult.Message); + } + + public void OnAcknowledgeSucceeded(PurchaseData purchase, OneStore.Purchasing.ProductType type) + { + Debug.Log("OnAcknowledgeSucceeded : " + purchase.ProductId); + } + + public void OnConsumeFailed(IapResult iapResult) + { + Debug.Log("OnConsumeFailed : " + iapResult.Message); + } + + public void OnConsumeSucceeded(PurchaseData purchase) + { + Debug.Log("OnConsumeSucceeded " + purchase.ProductId); + GameManager.IAP.AddProductItem(purchase.ProductId); + GameManager.UI.ShowNStackPopup(EPopupType.SuccessIAPPopup); + } + + public void OnManageRecurringProduct(IapResult iapResult, PurchaseData purchase, RecurringAction action) + { + Debug.Log("OnManageRecurringProduct : " + iapResult.Message); + } + + public void OnNeedLogin() + { + new OneStoreAuthClientImpl().LaunchSignInFlow(signInResult => + { + if (signInResult.IsSuccessful()) + { + + } + }); + } + + public void OnNeedUpdate() + { + m_PurchaseClientImpl.LaunchUpdateOrInstallFlow(null); + } + + public void OnProductDetailsFailed(IapResult iapResult) { Debug.Log(iapResult.ToString()); } + + public void OnProductDetailsSucceeded(List productDetails) + { + m_productDetails = productDetails; + //for (int i = 0; i < productDetails.Count; i++) + // DevTool.Ins.m_MyLog.Add(productDetails[i].productId + " " + productDetails[i].price); + } + + public void OnPurchaseFailed(IapResult iapResult) + { + Debug.Log("OnPurchaseFailed : " + iapResult.Message); + //GameManager.UI.ShowNStackPopup(EPopupType.FailIAPPopup); + } + + public void OnPurchaseSucceeded(List purchases) + { // 결제 성공 or 미지급된 아이템 지급 + for (int i = 0; i < purchases.Count; i++) + { + var purchaseData = purchases[i]; + m_PurchaseClientImpl.ConsumePurchase(purchaseData); + } + } + + public void OnSetupFailed(IapResult iapResult) + { + Debug.Log("OnSetupFailed : " + iapResult.Message); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/SingletonManagers/Managers/UIManager.cs b/Assets/Scripts/SingletonManagers/Managers/UIManager.cs index c30426d..9883886 100644 --- a/Assets/Scripts/SingletonManagers/Managers/UIManager.cs +++ b/Assets/Scripts/SingletonManagers/Managers/UIManager.cs @@ -33,6 +33,7 @@ public enum EPopupType AgreeConditionsPopup, NotOnline_ClosePopup, NotEnoughGoldPopup, + SuccessIAPPopup, FailIAPPopup, FailLoadADSPopup, NotVaildFreeHeartPopup, @@ -379,6 +380,8 @@ public class UIManager : MonoBehaviour return Instantiate(Resources.Load(path + "AgreeConditionsPopup"), PopupCanvasTransform); case EPopupType.NotOnline_ClosePopup: return Instantiate(Resources.Load(path + "NotOnline_ClosePopup"), PopupCanvasTransform); + case EPopupType.SuccessIAPPopup: + return Instantiate(Resources.Load(path + "SuccessIAPPopup"), PopupCanvasTransform); case EPopupType.FailIAPPopup: return Instantiate(Resources.Load(path + "FailIAPPopup"), PopupCanvasTransform); case EPopupType.FailLoadADSPopup: diff --git a/Assets/Scripts/UI/TitleScene/TitleCanvas.cs b/Assets/Scripts/UI/TitleScene/TitleCanvas.cs index 90d3fad..cb6c702 100644 --- a/Assets/Scripts/UI/TitleScene/TitleCanvas.cs +++ b/Assets/Scripts/UI/TitleScene/TitleCanvas.cs @@ -33,6 +33,8 @@ public class TitleCanvas : MonoBehaviour private void Awake() { + Screen.sleepTimeout = SleepTimeout.NeverSleep; + if (GameManager.Instance != null) Debug.Log("base: Call Manager"); diff --git a/ProjectSettings/AndroidResolverDependencies.xml b/ProjectSettings/AndroidResolverDependencies.xml index 4f5fc0b..c64406a 100644 --- a/ProjectSettings/AndroidResolverDependencies.xml +++ b/ProjectSettings/AndroidResolverDependencies.xml @@ -8,8 +8,8 @@ com.google.android.ump:user-messaging-platform:3.1.0 com.google.games:gpgs-plugin-support:2.1.0 com.google.signin:google-signin-support:1.0.4 - com.onestorecorp.sdk:sdk-iap:21.01.00 - com.onestorecorp.sdk:sdk-licensing:2.1.0 + com.onestorecorp.sdk:sdk-iap:21.02.01 + com.onestorecorp.sdk:sdk-licensing:2.2.1 com.unity3d.ads:unity-ads:4.12.3 diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 7ec1da0..8b46a7b 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -140,7 +140,7 @@ PlayerSettings: loadStoreDebugModeEnabled: 0 visionOSBundleVersion: 1.0 tvOSBundleVersion: 1.0 - bundleVersion: 9.9.9 + bundleVersion: 0.0.1 preloadedAssets: [] metroInputSource: 0 wsaTransparentSwapchain: 0