parent
							
								
									2dd94403ea
								
							
						
					
					
						commit
						28c1dd47a6
					
				|  | @ -12,7 +12,7 @@ namespace Guru | |||
| 		public static string IPM_X_APP_ID => GuruSettings.Instance.IPMSetting.AppId; | ||||
| 		public static int TOKEN_VALID_TIME => GuruSettings.Instance.IPMSetting.TokenValidTime; | ||||
| 		public static readonly int FIREBASE_TOKEN_VALID_TIME = TimeUtil.HOUR_TO_SECOND; | ||||
| 		public static bool UsingUUID = false; | ||||
| 		public static bool UsingUUID = GuruSettings.Instance.UsingUUID(); | ||||
| 		 | ||||
| 
 | ||||
| 		public static readonly string Header_Param_APPID = "X-APP-ID"; | ||||
|  | @ -48,14 +48,7 @@ namespace Guru | |||
| 			{ | ||||
| 				if (string.IsNullOrEmpty(SavedDeviceId)) | ||||
| 				{ | ||||
| 					if (UsingUUID) | ||||
| 					{ | ||||
| 						SavedDeviceId = GenerateDeviceIdV2(); | ||||
| 					} | ||||
| 					else | ||||
| 					{ | ||||
| 						SavedDeviceId = GenerateDeviceIdV1(); | ||||
| 					} | ||||
| 					GenDeviceId(); | ||||
| 				} | ||||
| 				return SavedDeviceId; // 优先使用缓存的 DeviceID | ||||
| 			} | ||||
|  | @ -99,6 +92,19 @@ namespace Guru | |||
| 			set => PlayerPrefs.SetString(nameof(SavedDeviceId), value); | ||||
| 		} | ||||
| 		 | ||||
| 		public static void GenDeviceId() | ||||
| 		{ | ||||
| 			if (UsingUUID) | ||||
| 			{ | ||||
| 				SavedDeviceId = GenerateDeviceIdV2(); | ||||
| 			} | ||||
| 			else | ||||
| 			{ | ||||
| 				SavedDeviceId = GenerateDeviceIdV1(); | ||||
| 			} | ||||
| 			Debug.Log($"[SDK] Gen DeviceID with UUID:{UsingUUID} : {SavedDeviceId}"); | ||||
| 		} | ||||
| 		 | ||||
| 		/// <summary> | ||||
| 		/// 设置 DeviceID, 此处设计覆写原则 | ||||
| 		/// </summary> | ||||
|  |  | |||
|  | @ -94,7 +94,7 @@ namespace Guru | |||
| 		public void UpdateAppSettings(string bundleId = "", string fbAppId = "", | ||||
| 			string supportEmail = "", | ||||
| 			string privacyUrl = "", string termsUrl = "",  | ||||
| 			string androidStoreUrl = "", string iosStoreUrl = "", string cdnHost = "") | ||||
| 			string androidStoreUrl = "", string iosStoreUrl = "", string usingUUID = "", string cdnHost = "") | ||||
| 		{ | ||||
| 			if (!string.IsNullOrEmpty(bundleId)) IPMSetting.bundleId = bundleId; | ||||
| 			if (!string.IsNullOrEmpty(supportEmail)) SupportEmail = supportEmail; | ||||
|  | @ -104,7 +104,11 @@ namespace Guru | |||
| 			if (!string.IsNullOrEmpty(iosStoreUrl)) IOSStoreUrl = iosStoreUrl; | ||||
| 			if (!string.IsNullOrEmpty(fbAppId)) IPMSetting.fbAppId = fbAppId; | ||||
| 			if (!string.IsNullOrEmpty(cdnHost)) IPMSetting.cdnHost = cdnHost; | ||||
| 			if (!string.IsNullOrEmpty(usingUUID)) IPMSetting.usingUUID = usingUUID.ToLower() == "true" || usingUUID == "1"; | ||||
| 		} | ||||
| 		 | ||||
| 		public string CdnHost() => IPMSetting.cdnHost; | ||||
| 		public bool UsingUUID() => IPMSetting.usingUUID; | ||||
| 	} | ||||
| 	 | ||||
| 	[Serializable] | ||||
|  | @ -122,13 +126,14 @@ namespace Guru | |||
| 		[SerializeField] internal string fbClientToken; | ||||
| 		[Header("Cdn Host 地址")] | ||||
| 		[SerializeField] internal string cdnHost; | ||||
| 		[Header("是否使用 UUID")]  | ||||
| 		[SerializeField] internal bool usingUUID = true; | ||||
| 		 | ||||
| 		public string AppId => appID; | ||||
| 		public int TokenValidTime => tokenValidTime; | ||||
| 		public string AppBundleId => bundleId; | ||||
| 		public string FacebookAppId => fbAppId; | ||||
| 		public string FacebookClientToken => fbClientToken; | ||||
| 		public string CdnHost => cdnHost; | ||||
| 	} | ||||
| 
 | ||||
| 	[Serializable] | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue