fix: 修复属性上报递归的 BUG
Signed-off-by: huyufei <yufei.hu@castbox.fm>
							parent
							
								
									1f25a928d0
								
							
						
					
					
						commit
						c719eb2edb
					
				|  | @ -73,20 +73,15 @@ namespace Guru | |||
| 		{ | ||||
| 			if (_hasSetUid) return; | ||||
| 			if (string.IsNullOrEmpty(uid)) return; | ||||
| 			Debug.Log($"---[ANA] UID: {uid}"); | ||||
| 			bool flag1 = false, flag2 = false; | ||||
| 			if (GuruAnalytics.IsReady) | ||||
| 			{ | ||||
| 				GuruAnalytics.Instance.SetUid(uid); | ||||
| 				flag1 = true; | ||||
| 			} | ||||
| 
 | ||||
| 			if (IsFirebaseReady) | ||||
| 			{ | ||||
| 				FirebaseAnalytics.SetUserId(uid); | ||||
| 				flag2 = true; | ||||
| 			} | ||||
| 			_hasSetUid = flag1 && flag2; | ||||
| 			if (!IsFirebaseReady) return; | ||||
| 			SetFirebaseUserId(uid); | ||||
| 			 | ||||
| 			if (!GuruAnalytics.IsReady) return; | ||||
| 			GuruAnalytics.Instance.SetUid(uid); | ||||
| 
 | ||||
| 			Debug.Log($"---[ANA] UID: {uid}"); | ||||
| 			_hasSetUid = true; | ||||
| 		} | ||||
| 
 | ||||
| 		/// <summary> | ||||
|  | @ -95,13 +90,11 @@ namespace Guru | |||
| 		private static void SetDeviceId(string deviceId) | ||||
| 		{ | ||||
| 			if (_hasSetDeviceId) return; | ||||
| 			if (string.IsNullOrEmpty(deviceId)) return; | ||||
| 			 | ||||
| 			if (!string.IsNullOrEmpty(deviceId)) | ||||
| 			{ | ||||
| 				GuruAnalytics.Instance.SetDeviceId(deviceId); | ||||
| 				FirebaseAnalytics.SetUserProperty(PropertyDeviceID, deviceId); | ||||
| 				_hasSetDeviceId = true; | ||||
| 			} | ||||
| 			if (!GuruAnalytics.IsReady) return; | ||||
| 			GuruAnalytics.Instance.SetDeviceId(deviceId); | ||||
| 			_hasSetDeviceId = true; | ||||
| 		} | ||||
| 		 | ||||
| 		/// <summary> | ||||
|  | @ -110,16 +103,12 @@ namespace Guru | |||
| 		private static void SetAdjustId(string adjustId) | ||||
| 		{ | ||||
| 			if (_hasSetAdjustId) return; | ||||
| 			if (string.IsNullOrEmpty(adjustId)) return; | ||||
| 			if (!GuruAnalytics.IsReady) return; | ||||
| 
 | ||||
| 			GuruAnalytics.Instance.SetAdjustId(adjustId); | ||||
| 			_hasSetAdjustId = true; | ||||
| 
 | ||||
| 			if (!string.IsNullOrEmpty(adjustId)) | ||||
| 			{ | ||||
| 				GuruAnalytics.Instance.SetAdjustId(adjustId); | ||||
| 				_hasSetAdjustId = true; | ||||
| 			} | ||||
| 			else | ||||
| 			{ | ||||
| 				Debug.Log($"--- [ANA] AdjustId is Empty.."); | ||||
| 			} | ||||
| 
 | ||||
| 		} | ||||
| 		 | ||||
|  | @ -129,29 +118,23 @@ namespace Guru | |||
| 		private static void SetAdId(string adId) | ||||
| 		{ | ||||
| 			if (_hasSetAdId) return; | ||||
| 
 | ||||
| 			if (string.IsNullOrEmpty(adId)) return; | ||||
| 			if (!GuruAnalytics.IsReady) return; | ||||
| 			GuruAnalytics.Instance.SetAdId(adId); | ||||
| 			_hasSetAdId = true; | ||||
| 
 | ||||
| 		} | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| 		 | ||||
| 		/// <summary> | ||||
| 		/// 设置FirebaseId | ||||
| 		/// </summary> | ||||
| 		private static void SetFirebaseId(string firebaseId) | ||||
| 		{ | ||||
| 			if (_hasSetFirebaseId) return; | ||||
| 			 | ||||
| 			if (!string.IsNullOrEmpty(firebaseId)) | ||||
| 			{ | ||||
| 				GuruAnalytics.Instance.SetFirebaseId(firebaseId); | ||||
| 				_hasSetFirebaseId = true; | ||||
| 			} | ||||
| 			if (string.IsNullOrEmpty(firebaseId)) return; | ||||
| 			if (!GuruAnalytics.IsReady) return; | ||||
| 			GuruAnalytics.Instance.SetFirebaseId(firebaseId); | ||||
| 			_hasSetFirebaseId = true; | ||||
| 		} | ||||
| 
 | ||||
| 		/// <summary> | ||||
|  | @ -188,16 +171,19 @@ namespace Guru | |||
| 
 | ||||
| 	    private static void SetIDFV(string idfv) | ||||
| 	    { | ||||
| 			if(_hasSetIDFV) return; | ||||
| 			if (_hasSetIDFV) return; | ||||
| 		    if (string.IsNullOrEmpty(idfv)) return; | ||||
| 			if (!GuruAnalytics.IsReady) return; | ||||
| 		    GuruAnalytics.Instance.SetIDFV(idfv); | ||||
| 			_hasSetIDFV = true; | ||||
| 	    } | ||||
| 
 | ||||
| 		private static void SetIDFA(string idfa) | ||||
| 		{ | ||||
| 			if(_hasSetIDFA) return; | ||||
| 			if (_hasSetIDFA) return; | ||||
| 			if (string.IsNullOrEmpty(idfa)) return; | ||||
| 			if (!GuruAnalytics.IsReady) return; | ||||
| 
 | ||||
| 			GuruAnalytics.Instance.SetIDFA(idfa); | ||||
| 			_hasSetIDFA = true; | ||||
| 		} | ||||
|  | @ -211,6 +197,7 @@ namespace Guru | |||
| 	    { | ||||
| 		    if (_hasSetAndroidId) return; | ||||
| 		    if (string.IsNullOrEmpty(androidId)) return; | ||||
| 		    if (!GuruAnalytics.IsReady) return; | ||||
| 		    GuruAnalytics.Instance.SetAndroidID(androidId); | ||||
| 		    _hasSetAndroidId = true; | ||||
| 	    } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue