Răsfoiți Sursa

ios 兼容两个支付以及登录入口

hexiaojie 11 luni în urmă
părinte
comite
48ecf77088

+ 69 - 11
GameClient/Assets/Game/HotUpdate/Platform/QDManager.cs

@@ -25,10 +25,15 @@ namespace GFGGame
                     QDShareManager.Instance.Init();
                     break;
                 case (int)ChannelID.AppStore:
-#if !UNITY_EDITOR && UNITY_IOS
-                    //QDAppStoreManager.Init();
-#endif
-                    QDDouYouManagerIos.Instance.Init();
+                    if (LauncherConfig.isUseDouYouIos == "1")
+                    {
+                        QDDouYouManagerIos.Instance.Init();
+                    }
+                    else
+                    {
+                        QDAppStoreManager.Init();
+                    }
+
                     break;
                 default:
                     break;
@@ -56,7 +61,20 @@ namespace GFGGame
                     QDDouYouManager.Instance.Login();
                     break;
                 case (int)ChannelID.AppStore:
-                    QDDouYouManagerIos.Instance.Login();
+                    if (LauncherConfig.isUseDouYouIos == "1")
+                    {
+                        QDDouYouManagerIos.Instance.Login();
+                    }
+                    else
+                    {
+                        bool loginAppStore = GameController.CheckLoginCache(true);
+                        if (!loginAppStore)
+                        {
+                            ViewManager.Hide<ModalStatusView>();
+                            ViewManager.Show<LoginInputView>();
+                        }
+                    }
+
                     break;
                 default:
                     break;
@@ -77,7 +95,15 @@ namespace GFGGame
                     QDDouYouManager.Instance.OnCreateRole();
                     break;
                 case (int)ChannelID.AppStore:
-                    QDDouYouManagerIos.Instance.OnCreateRole();
+                    if (LauncherConfig.isUseDouYouIos == "1")
+                    {
+                        QDDouYouManagerIos.Instance.OnCreateRole();
+                    }
+                    else
+                    {
+                        QDAppStoreManager.OnCreateRole();
+                    }
+
                     break;
                 default:
                     break;
@@ -98,7 +124,15 @@ namespace GFGGame
                     QDDouYouManager.Instance.OnEnterGame();
                     break;
                 case (int)ChannelID.AppStore:
-                    QDDouYouManagerIos.Instance.OnEnterGame();
+                    if (LauncherConfig.isUseDouYouIos == "1")
+                    {
+                        QDDouYouManagerIos.Instance.OnEnterGame();
+                    }
+                    else
+                    {
+                        QDAppStoreManager.OnEnterGame();
+                    }
+
                     break;
                 default:
                     break;
@@ -120,7 +154,11 @@ namespace GFGGame
                     QDDouYouManager.Instance.OnQuitToLoginView();
                     break;
                 case (int)ChannelID.AppStore:
-                    QDDouYouManagerIos.Instance.OnQuitToLoginView();
+                    if (LauncherConfig.isUseDouYouIos == "1")
+                    {
+                        QDDouYouManagerIos.Instance.OnQuitToLoginView();
+                    }
+              
                     break;
                 default:
                     break;
@@ -141,7 +179,15 @@ namespace GFGGame
                     QDDouYouManager.Instance.Pay(buyID, count, orderID, price);
                     break;
                 case (int)ChannelID.AppStore:
-                    QDDouYouManagerIos.Instance.Pay(buyID, count, orderID, price);
+                    if (LauncherConfig.isUseDouYouIos == "1")
+                    {
+                        QDDouYouManagerIos.Instance.Pay(buyID, count, orderID, price);
+                    }
+                    else
+                    {
+                        QDAppStoreManager.Pay(buyID, count, orderID, price);
+                    }
+                    
                     break;
                 default:
                     break;
@@ -170,7 +216,15 @@ namespace GFGGame
                     QDDouYouManager.Instance.Logout();
                     break;
                 case (int)ChannelID.AppStore:
-                    QDDouYouManagerIos.Instance.Logout();
+                    if (LauncherConfig.isUseDouYouIos == "1")
+                    {
+                        QDDouYouManagerIos.Instance.Logout();
+                    }
+                    else
+                    {
+                        ViewManager.Show<LoginInputView>();
+                    }
+         
                     break;
                 default:
                     break;
@@ -191,7 +245,11 @@ namespace GFGGame
                     QDDouYouManager.Instance.Exit();
                     break;
                 case (int)ChannelID.AppStore:
-                    QDDouYouManagerIos.Instance.Exit();
+                    if (LauncherConfig.isUseDouYouIos == "1")
+                    {
+                        QDDouYouManagerIos.Instance.Exit();
+                    }
+                    
                     break;
                 default:
                     break;

+ 0 - 71
GameClient/Assets/Game/HotUpdate/Platform/ReYunSDKManager.cs

@@ -1,71 +0,0 @@
-// using System;
-// using GFGGame.Launcher;
-// using UnityEngine;
-//
-// namespace GFGGame
-// {
-//     public class ReYunSDKManager : SingletonMonoBase<ReYunSDKManager>
-//     {
-//         public const string APPKEY = "f7c3bc1b98b6d0a6b5a1642691cad1f7";
-//
-//         private void Awake()
-//         {
-//             Tracking.Instance.preInit(APPKEY);
-//
-//             //Tracking.Instance.setAttributionCalllbackDelegate(OnAttibutionCallback);
-//             //Application.deepLinkActivated += OnDeepLinkActivated;
-//             //Tracking.Instance.setDeferredDeeplinkCalllbackDelegate(OnDeeplinkCallback);
-//             //Tracking.Instance.setPrintLog(LauncherConfig.onDebug > 0);
-//         }
-//
-//         private void Start()
-//         {
-//             Tracking.Instance.init(APPKEY, "_default_");
-//             //if (!string.IsNullOrEmpty(Application.absoluteURL))
-//             //{
-//             //    OnDeepLinkActivated(Application.absoluteURL);
-//             //}
-//             LogUtil.LogDev("ReYunSDKManager init");
-//         }
-//
-//         public void Init()
-//         {
-//             
-//         }
-//
-//         public void Register(string account)
-//         {
-//             LogUtil.LogDev($"ReYunSDKManager Register {account}");
-//             Tracking.Instance.register(account);
-//         }
-//
-//         public void Login(string account)
-//         {
-//             LogUtil.LogDev($"ReYunSDKManager Login {account}");
-//             Tracking.Instance.login(account);
-//         }
-//
-//         public void SetDD(string orderId, float price)
-//         {
-//             Tracking.Instance.setDD(orderId, "CNY", price);
-//         }
-//
-//         private void OnAttibutionCallback(string result, int status)
-//         {
-//             
-//         }
-//
-//         private void OnDeeplinkCallback(string msg)
-//         {
-//             
-//         }
-//
-//         private void OnDeepLinkActivated(string url)
-//         {
-//             Tracking.Instance.setEvent("invoke");
-//             Debug.Log("onDeepLinkActivated function call from unity url:" + url);
-//         }
-//
-//     }
-// }
-//

+ 0 - 11
GameClient/Assets/Game/HotUpdate/Platform/ReYunSDKManager.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: cac59633644fd447983cfc9eb5b4c72c
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 13 - 2
GameClient/Assets/Game/Launcher/LauncherConfig.cs

@@ -64,8 +64,12 @@ namespace GFGGame
         //新发行给的
         public static string showLog;
         public static string gameId;
+
         public static string douYouAdId;
 
+        //是否使用douYou的ios sdk 0不使用用douYouSdk 1使用douYouSdk
+        public static string isUseDouYouIos;
+
         public static void InitScriptCompilation()
         {
             launcherRootUrl = "http://gfg-client.obs.cn-north-4.myhuaweicloud.com/";
@@ -95,6 +99,7 @@ namespace GFGGame
             netType = EnumNetType.LOCAL;
             cfgName = "cfg_iosLocal";
             platformId = 2;
+            isUseDouYouIos = "1";
             ChannelId = (int)ChannelID.AppStore;
 #else
             netType = EnumNetType.LOCAL;
@@ -121,7 +126,7 @@ namespace GFGGame
             {
                 LauncherConfig.onDebug = int.Parse(result.onDebug);
             }
-            
+
             if (!string.IsNullOrEmpty(result.showLog))
             {
                 LauncherConfig.showLog = result.showLog;
@@ -136,7 +141,12 @@ namespace GFGGame
             {
                 LauncherConfig.douYouAdId = result.douYouAdId;
             }
-            
+
+            if (!string.IsNullOrEmpty(result.isUseDouYouIos))
+            {
+                LauncherConfig.isUseDouYouIos = result.isUseDouYouIos;
+            }
+
             LauncherConfig.manifest_v = result.manifest_v;
             LauncherConfig.privacy_v = result.privacy_v;
             LauncherConfig.statusPrompt = result.statusPrompt;
@@ -172,6 +182,7 @@ namespace GFGGame
             public string gameId;
             public string showLog;
             public string updateEndTime; //更新最后时间
+            public string isUseDouYouIos;
         }
     }
 }

+ 10 - 3
GameClient/Assets/Game/Launcher/Platform/QDManagerInit.cs

@@ -18,9 +18,16 @@ namespace GFGGame.Launcher
                     QDShareManagerInit.Instance.InitSDK();
                     break;
                 case (int)ChannelID.AppStore:
-                    //QDAppStoreManagerInit.InitPlatform();
-                    QDDouYouManagerInitIos.Instance.InitSDK(LauncherConfig.gameId, LauncherConfig.douYouAdId,
-                        LauncherConfig.showLog == "1");
+                    if (LauncherConfig.isUseDouYouIos == "1")
+                    {
+                        QDDouYouManagerInitIos.Instance.InitSDK(LauncherConfig.gameId, LauncherConfig.douYouAdId,
+                            LauncherConfig.showLog == "1");
+                    }
+                    else
+                    {
+                        QDAppStoreManagerInit.InitPlatform();
+                    }
+                    
                     break;
                 default:
                     UniEvent.SendMessage(new LauncherEvent.InitPlatformResult() { success = true });