diff --git a/Runtime/GuruCore/Runtime/ExtensionKit/DeviceIDHelper.cs b/Runtime/GuruCore/Runtime/ExtensionKit/DeviceIDHelper.cs index abbdc24..d9468ab 100644 --- a/Runtime/GuruCore/Runtime/ExtensionKit/DeviceIDHelper.cs +++ b/Runtime/GuruCore/Runtime/ExtensionKit/DeviceIDHelper.cs @@ -7,7 +7,7 @@ namespace Guru /// UUID (V4) /// /// - public static string UUID => System.Guid.NewGuid().ToString(); + public static string UUID => System.Guid.NewGuid().ToString("D"); /// diff --git a/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs b/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs index 3ca3c98..07961fc 100644 --- a/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs +++ b/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs @@ -22,7 +22,7 @@ namespace Guru private const string DefaultCategory = "Store"; private static bool _showLog; - private static string _userId; + private static string _uuid; private ConfigurationBuilder _configBuilder; // 商店配置创建器 @@ -133,9 +133,9 @@ namespace Guru /// /// 初始化支付服务 /// - public virtual void Initialize(string userId, bool showLog = false) + public virtual void Initialize(string uuid, bool showLog = false) { - _userId = userId; + _uuid = uuid; _showLog = showLog; InitPurchasing(); } @@ -143,16 +143,16 @@ namespace Guru /// /// 带有校验器的初始化 /// - /// + /// /// /// /// - public virtual void InitWithKeys(string userId, byte[] googlePublicKey, byte[] appleRootCert, bool showLog = false) + public virtual void InitWithKeys(string uuid, byte[] googlePublicKey, byte[] appleRootCert, bool showLog = false) { _googlePublicKey = googlePublicKey; _appleRootCert = appleRootCert; InitModel(); - Initialize(userId, showLog); + Initialize(uuid, showLog); } /// @@ -229,9 +229,9 @@ namespace Guru { _storeController = controller; _storeExtensionProvider = extensions; - if (string.IsNullOrEmpty(_userId)) _userId = IPMConfig.IPM_UID; + if (string.IsNullOrEmpty(_uuid)) _uuid = IPMConfig.IPM_DEVICE_ID; - LogI($"--- IAP Initialized Success. With UID: {_userId}"); + LogI($"--- IAP Initialized Success. With UID: {_uuid}"); #if UNITY_IOS _appleExtensions = extensions.GetExtension(); @@ -244,7 +244,7 @@ namespace Guru OnAppStorePurchaseDeferred?.Invoke(item); }); #elif UNITY_ANDROID - _configBuilder.Configure().SetObfuscatedAccountId(_userId); // SetUp UID + _configBuilder.Configure().SetObfuscatedAccountId(_uuid); // SetUp UID _googlePlayStoreExtensions = extensions.GetExtension(); // _googlePlayStoreExtensions.SetObfuscatedAccountId(IPMConfig.IPM_UID); //添加安装游戏后第一次初试化进行恢复购买的回调 只有安卓才有