parent
							
								
									3c22bea3f7
								
							
						
					
					
						commit
						2dd94403ea
					
				| 
						 | 
					@ -7,7 +7,7 @@ namespace Guru
 | 
				
			||||||
        /// UUID (V4) 
 | 
					        /// UUID (V4) 
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static string UUID => System.Guid.NewGuid().ToString();
 | 
					        public static string UUID => System.Guid.NewGuid().ToString("D");
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -22,7 +22,7 @@ namespace Guru
 | 
				
			||||||
        private const string DefaultCategory = "Store";
 | 
					        private const string DefaultCategory = "Store";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        private static bool _showLog;
 | 
					        private static bool _showLog;
 | 
				
			||||||
        private static string _userId;
 | 
					        private static string _uuid;
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        private ConfigurationBuilder _configBuilder; // 商店配置创建器
 | 
					        private ConfigurationBuilder _configBuilder; // 商店配置创建器
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
| 
						 | 
					@ -133,9 +133,9 @@ namespace Guru
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 初始化支付服务
 | 
					        /// 初始化支付服务
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        public virtual void Initialize(string userId, bool showLog = false)
 | 
					        public virtual void Initialize(string uuid, bool showLog = false)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _userId = userId;
 | 
					            _uuid = uuid;
 | 
				
			||||||
            _showLog = showLog;
 | 
					            _showLog = showLog;
 | 
				
			||||||
            InitPurchasing();
 | 
					            InitPurchasing();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					@ -143,16 +143,16 @@ namespace Guru
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 带有校验器的初始化
 | 
					        /// 带有校验器的初始化
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="userId"></param>
 | 
					        /// <param name="uuid"></param>
 | 
				
			||||||
        /// <param name="googlePublicKey"></param>
 | 
					        /// <param name="googlePublicKey"></param>
 | 
				
			||||||
        /// <param name="appleRootCert"></param>
 | 
					        /// <param name="appleRootCert"></param>
 | 
				
			||||||
        /// <param name="showLog"></param>
 | 
					        /// <param name="showLog"></param>
 | 
				
			||||||
        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;
 | 
					            _googlePublicKey = googlePublicKey;
 | 
				
			||||||
            _appleRootCert = appleRootCert;
 | 
					            _appleRootCert = appleRootCert;
 | 
				
			||||||
            InitModel();
 | 
					            InitModel();
 | 
				
			||||||
            Initialize(userId, showLog);
 | 
					            Initialize(uuid, showLog);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
| 
						 | 
					@ -229,9 +229,9 @@ namespace Guru
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            _storeController = controller;
 | 
					            _storeController = controller;
 | 
				
			||||||
            _storeExtensionProvider = extensions;
 | 
					            _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
 | 
					#if UNITY_IOS
 | 
				
			||||||
            _appleExtensions = extensions.GetExtension<IAppleExtensions>();
 | 
					            _appleExtensions = extensions.GetExtension<IAppleExtensions>();
 | 
				
			||||||
| 
						 | 
					@ -244,7 +244,7 @@ namespace Guru
 | 
				
			||||||
                OnAppStorePurchaseDeferred?.Invoke(item);
 | 
					                OnAppStorePurchaseDeferred?.Invoke(item);
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
#elif UNITY_ANDROID
 | 
					#elif UNITY_ANDROID
 | 
				
			||||||
            _configBuilder.Configure<IGooglePlayConfiguration>().SetObfuscatedAccountId(_userId); // SetUp UID
 | 
					            _configBuilder.Configure<IGooglePlayConfiguration>().SetObfuscatedAccountId(_uuid); // SetUp UID
 | 
				
			||||||
            _googlePlayStoreExtensions = extensions.GetExtension<IGooglePlayStoreExtensions>();
 | 
					            _googlePlayStoreExtensions = extensions.GetExtension<IGooglePlayStoreExtensions>();
 | 
				
			||||||
            // _googlePlayStoreExtensions.SetObfuscatedAccountId(IPMConfig.IPM_UID);
 | 
					            // _googlePlayStoreExtensions.SetObfuscatedAccountId(IPMConfig.IPM_UID);
 | 
				
			||||||
            //添加安装游戏后第一次初试化进行恢复购买的回调 只有安卓才有
 | 
					            //添加安装游戏后第一次初试化进行恢复购买的回调 只有安卓才有
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue