update: 更新 Adjust 的 DeepLink 功能
--story=1020917 --user=yufei.hu 【中台】【SDK】新增 Adjust Deeplink 接口 https://www.tapd.cn/33527076/s/1156644deeplink
							parent
							
								
									8932d6893f
								
							
						
					
					
						commit
						957f60e797
					
				|  | @ -44,6 +44,10 @@ namespace Guru | |||
|         /// </summary> | ||||
|         /// <returns></returns> | ||||
|         public Dictionary<string, object> DefaultRemoteData = new Dictionary<string, object>(); | ||||
|         /// <summary> | ||||
|         /// 启用 AdjustDeeplink | ||||
|         /// </summary> | ||||
|         public bool UseAdjustDeeplink = false; | ||||
|          | ||||
|         /// <summary> | ||||
|         /// 支付初始化Keys | ||||
|  | @ -65,6 +69,7 @@ namespace Guru | |||
|             bool isBuyNoAds = false, | ||||
|             string bannerBackgroundColor = "#00000000", | ||||
|             bool debugMode = false, | ||||
|             bool useAdjustDeeplink = false, | ||||
|             Dictionary<string, object> defaultRemoteData = null, | ||||
|             byte[] googleKeys = null, | ||||
|             byte[] appleRootCerts = null) | ||||
|  | @ -79,6 +84,7 @@ namespace Guru | |||
|                 IsBuyNoAds = isBuyNoAds, | ||||
|                 BannerBackgroundColor = bannerBackgroundColor, | ||||
|                 DebugMode = debugMode, | ||||
|                 UseAdjustDeeplink = useAdjustDeeplink, | ||||
|                 GoogleKeys = googleKeys, | ||||
|                 AppleRootCerts = appleRootCerts, | ||||
|                 DefaultRemoteData = defaultRemoteData ?? new Dictionary<string, object>(), | ||||
|  |  | |||
|  | @ -232,6 +232,14 @@ namespace Guru | |||
|                 } | ||||
|                  | ||||
|                  | ||||
|                 // DeepLink 回调  | ||||
|                 internal static Action<string> _onDeeplinkCallback; | ||||
|                 public static event Action<string> OnDeeplinkCallback | ||||
|                 { | ||||
|                     add => _onDeeplinkCallback += value; | ||||
|                     remove => _onDeeplinkCallback -= value; | ||||
|                 } | ||||
|                  | ||||
|             } | ||||
| 
 | ||||
|         } | ||||
|  |  | |||
|  | @ -94,6 +94,7 @@ namespace Guru | |||
|             bool autoRecordFinishedLevels = true,  | ||||
|             bool debugMode = false, | ||||
|             bool isBuyNoAds = false, | ||||
|             bool useAdjustDeeplink = false, | ||||
|             string bannerColor = "#00000000", | ||||
|             Dictionary<string, object> defaultRemoteData = null, | ||||
|             byte[] googleKeys = null, | ||||
|  | @ -101,7 +102,7 @@ namespace Guru | |||
|         { | ||||
|             var config = GuruSDKInitConfig.Build(useCustomConsent, autoLoadAds, iapEnabled,  | ||||
|                 autoRecordFinishedLevels, isBuyNoAds, bannerColor, | ||||
|                 debugMode, defaultRemoteData, googleKeys, appleRootCerts); | ||||
|                 debugMode, useAdjustDeeplink, defaultRemoteData, googleKeys, appleRootCerts); | ||||
|             return config; | ||||
|         } | ||||
| 
 | ||||
|  | @ -161,10 +162,7 @@ namespace Guru | |||
|             //---- Start All tools ---- | ||||
|             LogI($"#2 --- InitFirebase ---"); | ||||
|             //---------- Start Firebase ------------ | ||||
|             FirebaseUtil.onInitComplete += OnFirebaseReady; | ||||
|             FirebaseUtil.OnUserAuthResult += OnUserAuthResult; | ||||
|             FirebaseUtil.OnFirebaseAuthResult += OnFirebaseAuthResult; | ||||
|             FirebaseUtil.InitFirebase(null); // 确保所有的逻辑提前被调用到 | ||||
|             StartFirebaseService(); | ||||
|              | ||||
|             LogI($"#2.1 --- InitFacebook ---"); | ||||
|             //---------- Start Facebook ------------ | ||||
|  | @ -174,8 +172,23 @@ namespace Guru | |||
|             IsInitialSuccess = true; | ||||
|             _onCompleteCallback?.Invoke(true); | ||||
|         } | ||||
| 
 | ||||
|          | ||||
|         /// <summary> | ||||
|         /// 启动 Firebase 服务 | ||||
|         /// </summary> | ||||
|         private void StartFirebaseService() | ||||
|         { | ||||
|             FirebaseUtil.onInitComplete += OnFirebaseReady; | ||||
|             FirebaseUtil.OnUserAuthResult += OnUserAuthResult; | ||||
|             FirebaseUtil.OnFirebaseAuthResult += OnFirebaseAuthResult; | ||||
|              | ||||
|             if (InitConfig.UseAdjustDeeplink) | ||||
|             { | ||||
|                 FirebaseUtil.OnAdjustDeeplinkCallback = OnDeeplinkCallback; // 挂载 Deeplink 的回调 | ||||
|             } | ||||
|              | ||||
|             FirebaseUtil.InitFirebase(null); // 确保所有的逻辑提前被调用到 | ||||
|         } | ||||
| 
 | ||||
|         private void OnUserAuthResult(bool success) | ||||
|         { | ||||
|  | @ -751,6 +764,20 @@ namespace Guru | |||
|         } | ||||
| 
 | ||||
| 
 | ||||
|         #endregion | ||||
| 
 | ||||
|         #region Deeplink | ||||
|          | ||||
|         /// <summary> | ||||
|         /// 添加回调链接 | ||||
|         /// </summary> | ||||
|         /// <param name="deeplink"></param> | ||||
|         private void OnDeeplinkCallback(string deeplink) | ||||
|         { | ||||
|            Callbacks.SDK._onDeeplinkCallback?.Invoke(deeplink); // 尝试调用回调 | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|         #endregion | ||||
|     } | ||||
| } | ||||
		Loading…
	
		Reference in New Issue