浏览代码

ios sdk 加入跳转接口

gfgios 10 月之前
父节点
当前提交
a5b3d19ee4

+ 6 - 0
GameClient/Assets/Game/HotUpdate/Platform/QDDouYouManagerIos.cs

@@ -146,6 +146,12 @@ namespace GFGGame
             QDManager.PushRoleAction(DouYouRoleLogReportType.ExitGame);
             QDDouYouManagerInitIos.Instance.Logout();
         }
+        
+        public void Share(string url)
+        {
+            QDManager.PushRoleAction(DouYouRoleLogReportType.ExitGame);
+            QDDouYouManagerInitIos.Instance.JumpUrl(url);
+        }
     }
 
     /// <summary>

+ 12 - 1
GameClient/Assets/Game/HotUpdate/Platform/QDManager.cs

@@ -1,4 +1,5 @@
-using ET;
+using System;
+using ET;
 using GFGGame.Launcher;
 using UnityEngine;
 
@@ -279,6 +280,16 @@ namespace GFGGame
             }
         }
 
+        public static void TapTapShare(string url)
+        {
+#if PT_IosLocal
+            if (Convert.ToInt32(LauncherConfig.apkVersion) > 2.2)
+            {
+                QDDouYouManagerIos.Instance.Share(url);
+            }
+#endif
+        }
+
         //上报角色行为给sdk
         public static void PushRoleAction(DouYouRoleLogReportType reportType)
         {

+ 6 - 0
GameClient/Assets/Game/Launcher/Platform/QDDouYouManagerInitIos.cs

@@ -105,6 +105,12 @@ namespace GFGGame.Launcher
             douYouIosSDKHandler?.SDKRoleInfo(type, serverId, serverName, roleId, roleName, roleLevel, roleVip,
                 partyName, roleBalence);
         }
+        
+        public void JumpUrl(string url)
+        {
+            douYouIosSDKHandler?.SdkJumpUrl(url);
+            Debug.Log($"DouYouIosSDKHandler SdkJumpUrl:url:{url}");
+        }
 
         // 辅助方法:处理空值
         private static string HandleNullString(string value)

+ 25 - 11
GameClient/Assets/ThirdParty/DouYou/AbDouYouSDKIosHandler.cs

@@ -5,25 +5,30 @@ namespace DouYouSdk
 {
     public abstract class AbDouYouSDKIosHandler : MonoBehaviour
     {
-        [DllImport("__Internal", EntryPoint="__ImportInitWithDigitMap")]
+        [DllImport("__Internal", EntryPoint = "__ImportInitWithDigitMap")]
         private static extern void __ImportInitWithDigitMap(string gameId, string adId, bool shouldLog);
 
-        [DllImport("__Internal", EntryPoint="__ImportLogin")]
+        [DllImport("__Internal", EntryPoint = "__ImportLogin")]
         private static extern void __ImportLogin();
 
-        [DllImport("__Internal", EntryPoint="__ImportLogout")]
+        [DllImport("__Internal", EntryPoint = "__ImportLogout")]
         private static extern void __ImportLogout();
 
-        [DllImport("__Internal", EntryPoint="__ImportPaymentWithJson")]
-        private static extern void __ImportPaymentWithJson(string cpOrderId, string productPrice, string productId, string productName,
+        [DllImport("__Internal", EntryPoint = "__ImportPaymentWithJson")]
+        private static extern void __ImportPaymentWithJson(string cpOrderId, string productPrice, string productId,
+            string productName,
             string productDesc, string productCount, string exchangeRate, string currencyName, string serverId,
             string serverName, string roleId, string roleName, string roleLevel, string roleVip, string partyName,
             string roleBalence, string ext);
 
-        [DllImport("__Internal", EntryPoint="__ImportRoleInfoWithJson")]
-        private static extern void __ImportRoleInfoWithJson(string type, string serverId, string serverName, string roleId, string roleName,
+        [DllImport("__Internal", EntryPoint = "__ImportRoleInfoWithJson")]
+        private static extern void __ImportRoleInfoWithJson(string type, string serverId, string serverName,
+            string roleId, string roleName,
             string roleLevel, string roleVip, string partyName, string roleBalence);
 
+        [DllImport("__Internal", EntryPoint = "__ImportSdkJumpUrl")]
+        private static extern void __ImportSdkJumpUrl(string urlStr);
+
         //实例化sdk
         public virtual void SDKInitWithDigitMap(string gameId, string adId, bool shouldLog)
         {
@@ -46,7 +51,8 @@ namespace DouYouSdk
         }
 
         //调起支付
-        public virtual void SdkPaymentWithJson(string cpOrderId, string productPrice, string productId, string productName,
+        public virtual void SdkPaymentWithJson(string cpOrderId, string productPrice, string productId,
+            string productName,
             string productDesc, string productCount, string exchangeRate, string currencyName, string serverId,
             string serverName, string roleId, string roleName, string roleLevel, string roleVip, string partyName,
             string roleBalence, string ext)
@@ -54,8 +60,8 @@ namespace DouYouSdk
             __ImportPaymentWithJson(cpOrderId, productPrice, productId, productName, productDesc,
                 productCount, exchangeRate, currencyName, serverId, serverName, roleId, roleName, roleLevel, roleVip,
                 partyName, roleBalence, ext);
-            Debug.Log($"调起支付 SdkPaymentWithJson: cpOrderId:{cpOrderId} productPrice:{productPrice} productId:{productId} productName:{productName} productDesc:{productDesc} productCount:{productCount} exchangeRate:{exchangeRate} serverId:{serverId} serverName:{serverName} roleId:{roleId} roleName:{roleName} roleLevel:{roleLevel} roleVip:{roleVip} partyName:{partyName} roleBalence:{roleBalence} other:{ext}");
-
+            Debug.Log(
+                $"调起支付 SdkPaymentWithJson: cpOrderId:{cpOrderId} productPrice:{productPrice} productId:{productId} productName:{productName} productDesc:{productDesc} productCount:{productCount} exchangeRate:{exchangeRate} serverId:{serverId} serverName:{serverName} roleId:{roleId} roleName:{roleName} roleLevel:{roleLevel} roleVip:{roleVip} partyName:{partyName} roleBalence:{roleBalence} other:{ext}");
         }
 
         //角色升级上报
@@ -64,7 +70,15 @@ namespace DouYouSdk
         {
             __ImportRoleInfoWithJson(type, serverId, serverName, roleId, roleName, roleLevel, roleVip,
                 partyName, roleBalence);
-            Debug.Log($"角色上报 SDKRoleInfo. type:{type} serverId:{serverId} serverName:{serverName} roleId:{roleId} roleName:{roleName} roleLevel:{roleLevel} roleVip:{roleVip} partyName:{partyName} roleBalence:{roleBalence}");
+            Debug.Log(
+                $"角色上报 SDKRoleInfo. type:{type} serverId:{serverId} serverName:{serverName} roleId:{roleId} roleName:{roleName} roleLevel:{roleLevel} roleVip:{roleVip} partyName:{partyName} roleBalence:{roleBalence}");
+        }
+
+        //实例化sdk
+        public virtual void SdkJumpUrl(string urlStr)
+        {
+            __ImportSdkJumpUrl(urlStr);
+            Debug.Log($"SdkJumpUrl:urlStr:{urlStr}");
         }
 
         //监听回调====================================