Browse Source

ios 跳转到 taptap

gfgios 10 months ago
parent
commit
01fa10af40

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Platform/QDDouYouManagerIos.cs

@@ -147,10 +147,10 @@ namespace GFGGame
             QDDouYouManagerInitIos.Instance.Logout();
         }
         
-        public void Share(string url)
+        public void Share()
         {
             QDManager.PushRoleAction(DouYouRoleLogReportType.ExitGame);
-            QDDouYouManagerInitIos.Instance.JumpUrl(url);
+            QDDouYouManagerInitIos.Instance.JumpUrl();
         }
     }
 

+ 0 - 10
GameClient/Assets/Game/HotUpdate/Platform/QDManager.cs

@@ -280,16 +280,6 @@ 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)
         {

+ 5 - 0
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -564,6 +564,11 @@ namespace GFGGame
         {
 #if PT_DouYouTap
             QDDouYouManager.Instance.JumpInfo();
+#elif PT_IosLocal
+            if (Convert.ToInt32(LauncherConfig.apkVersion) > 2.2)
+            {
+                QDDouYouManagerIos.Instance.Share();
+            }
 #else
             _ui.m_btnTapTapJump.target.visible = false;
 #endif

+ 3 - 3
GameClient/Assets/Game/Launcher/Platform/QDDouYouManagerInitIos.cs

@@ -106,10 +106,10 @@ namespace GFGGame.Launcher
                 partyName, roleBalence);
         }
         
-        public void JumpUrl(string url)
+        public void JumpUrl()
         {
-            douYouIosSDKHandler?.SdkJumpUrl(url);
-            Debug.Log($"DouYouIosSDKHandler SdkJumpUrl:url:{url}");
+            douYouIosSDKHandler?.SdkJumpUrl();
+            Debug.Log($"DouYouIosSDKHandler SdkJumpUrl");
         }
 
         // 辅助方法:处理空值

+ 1 - 0
GameClient/Assets/Plugins/iOS/StraightPush/SDKManager.h

@@ -18,5 +18,6 @@
 - (void)Logout;
 - (void)PaymentWithJson:(NSDictionary *)paymentInfo;
 - (void)RoleInfoWithJson:(NSDictionary *)roleInfo;
+- (void)SdkJumpUrl;
 
 @end

+ 15 - 0
GameClient/Assets/Plugins/iOS/StraightPush/SDKManager.m

@@ -98,6 +98,21 @@
     }];
 }
 
+// 跳转URL
+- (void)SdkJumpUrl {
+    [[Promotion stillInstance] JumpUrlWithBlock:^(NSDictionary *params) {
+        if (self.shouldLog) {
+            NSLog(@"跳转成功%@", params);
+        }
+        [self sendJsonToUnity:params gameObject:"IosReceiverGameObj" methodName:"JumpUrlSuccess"];
+    } failureBlock:^(NSError *error) {
+        if (self.shouldLog) {
+            NSLog(@"跳转失败:%@", error);
+        }
+        [self sendErrorToUnity:error gameObject:"IosReceiverGameObj" methodName:"JumpUrlError"];
+    }];
+}
+
 //发送正常消息给unity
 - (void)sendJsonToUnity:(NSDictionary *)jsonData
              gameObject:(const char *)gameObject

+ 4 - 0
GameClient/Assets/Plugins/iOS/StraightPush/SDKManagerExt.mm

@@ -58,4 +58,8 @@ void __ImportRoleInfoWithJson(const char *type, const char *serverId, const char
         };
         [[SDKManager sharedInstance] RoleInfoWithJson:roleInfo];
     }
+
+void __ImportSdkJumpUrl() {
+    [[SDKManager sharedInstance] SdkJumpUrl];
+    }
 }

+ 4 - 4
GameClient/Assets/ThirdParty/DouYou/AbDouYouSDKIosHandler.cs

@@ -27,7 +27,7 @@ namespace DouYouSdk
             string roleLevel, string roleVip, string partyName, string roleBalence);
 
         [DllImport("__Internal", EntryPoint = "__ImportSdkJumpUrl")]
-        private static extern void __ImportSdkJumpUrl(string urlStr);
+        private static extern void __ImportSdkJumpUrl();
 
         //实例化sdk
         public virtual void SDKInitWithDigitMap(string gameId, string adId, bool shouldLog)
@@ -75,10 +75,10 @@ namespace DouYouSdk
         }
 
         //实例化sdk
-        public virtual void SdkJumpUrl(string urlStr)
+        public virtual void SdkJumpUrl()
         {
-            __ImportSdkJumpUrl(urlStr);
-            Debug.Log($"SdkJumpUrl:urlStr:{urlStr}");
+            __ImportSdkJumpUrl();
+            Debug.Log($"SdkJumpUrl");
         }
 
         //监听回调====================================