Browse Source

iosreyunsdk

ios 1 year ago
parent
commit
84fccb5c8b
28 changed files with 1636 additions and 24 deletions
  1. BIN
      GameClient/.DS_Store
  2. 16 2
      GameClient/Assets/Game/HotUpdate/Platform/QDAppStoreManager.cs
  3. 3 0
      GameClient/Assets/Game/HotUpdate/Platform/QDManager.cs
  4. 71 0
      GameClient/Assets/Game/HotUpdate/Platform/ReYunSDKManager.cs
  5. 11 0
      GameClient/Assets/Game/HotUpdate/Platform/ReYunSDKManager.cs.meta
  6. 2 1
      GameClient/Assets/Game/Launcher/LauncherConfig.cs
  7. 8 0
      GameClient/Assets/Game/Launcher/ReYunSDK.meta
  8. 564 0
      GameClient/Assets/Game/Launcher/ReYunSDK/MiniJSON.cs
  9. 11 0
      GameClient/Assets/Game/Launcher/ReYunSDK/MiniJSON.cs.meta
  10. 667 0
      GameClient/Assets/Game/Launcher/ReYunSDK/Tracking.cs
  11. 11 0
      GameClient/Assets/Game/Launcher/ReYunSDK/Tracking.cs.meta
  12. BIN
      GameClient/Assets/Plugins/.DS_Store
  13. 20 21
      GameClient/Assets/Plugins/NativeGallery/iOS/NativeGallery.mm.meta
  14. 8 0
      GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework.meta
  15. 44 0
      GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/Info.plist
  16. 7 0
      GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/Info.plist.meta
  17. 8 0
      GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64.meta
  18. 34 0
      GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework.meta
  19. 8 0
      GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Headers.meta
  20. 77 0
      GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Headers/Tracking.h
  21. 7 0
      GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Headers/Tracking.h.meta
  22. BIN
      GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Info.plist
  23. 7 0
      GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Info.plist.meta
  24. 8 0
      GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Modules.meta
  25. 30 0
      GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Modules/module.modulemap
  26. 7 0
      GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Modules/module.modulemap.meta
  27. BIN
      GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/TrackingIOSDK
  28. 7 0
      GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/TrackingIOSDK.meta

BIN
GameClient/.DS_Store


+ 16 - 2
GameClient/Assets/Game/HotUpdate/Platform/QDAppStoreManager.cs

@@ -1,5 +1,6 @@
 using UnityEngine.Purchasing;
 using UnityEngine;
+using ET;
 
 namespace GFGGame
 {
@@ -10,6 +11,9 @@ namespace GFGGame
             QDManager.isInited = true;
 
             IAPManager.Instance.InitializePurchasing();
+#if !UNITY_EDITOR
+            ReYunSDKManager.Instance.Init();
+#endif
         }
 
         public static void Pay(int buyID, int count, string orderID, long Price)
@@ -17,10 +21,22 @@ namespace GFGGame
             IAPManager.Instance.Pay(buyID, count, orderID, Price);
         }
 
+        public static void OnCreateRole()
+        {
+#if !UNITY_EDITOR
+            var accountInfoComponent = GameGlobal.zoneScene.GetComponent<AccountInfoComponent>();
+            ReYunSDKManager.Instance.Register(accountInfoComponent.Account);
+#endif
+        }
 
         public static void OnEnterGame()
         {
             IAPManager.Instance.CheckOrderToDo();
+
+#if !UNITY_EDITOR
+            var accountInfoComponent = GameGlobal.zoneScene.GetComponent<AccountInfoComponent>();
+            ReYunSDKManager.Instance.Login(accountInfoComponent.Account);
+#endif
         }
     }
 
@@ -131,7 +147,6 @@ namespace GFGGame
             Debug.Log("In-App Purchasing successfully initialized");
             m_StoreController = controller;
             m_AppleExtensions = extensions.GetExtension<IAppleExtensions>();
-            EventAgent.DispatchEvent(ConstMessage.ON_PLATFORM_SDK_INITED, true);
 
             // 在 Apple 平台上,我们需要处理由 Apple 的"购买前先询问"功能导致的延期购买。
             //在非 Apple 平台上,这将不起作用;永远不会调用 OnDeferred。
@@ -141,7 +156,6 @@ namespace GFGGame
         public void OnInitializeFailed(InitializationFailureReason error)
         {
             Debug.Log($"In-App Purchasing initialize failed: {error}");
-            EventAgent.DispatchEvent(ConstMessage.ON_PLATFORM_SDK_INITED, false);
         }
 
         public void OnPurchaseFailed(Product product, PurchaseFailureReason failureReason)

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

@@ -49,6 +49,9 @@
         {
             switch (LauncherConfig.ChannelId)
             {
+                case (int)ChannelID.AppStore:
+                    QDAppStoreManager.OnCreateRole();
+                    break;
                 default:
 
                     break;

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

@@ -0,0 +1,71 @@
+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);
+        }
+
+    }
+}
+

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

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

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

@@ -60,7 +60,8 @@ namespace GFGGame
             ChannelId = ChannelIDUtil.GetGameChannelID(quickChannel);
 #elif PT_IOS
             netType = EnumNetType.PUBLIC;
-            cfgName = "cfg_ios_2";
+            //cfgName = "cfg_ios_beta";
+            cfgName = "cfg_ios_3";
             platformId = 2;
             ChannelId = (int)ChannelID.AppStore;
 #elif PT_TISHEN

+ 8 - 0
GameClient/Assets/Game/Launcher/ReYunSDK.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5012e50c9a507492bbe95d4cca92f934
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 564 - 0
GameClient/Assets/Game/Launcher/ReYunSDK/MiniJSON.cs

@@ -0,0 +1,564 @@
+/*
+ * Copyright (c) 2013 Calvin Rien
+ *
+ * Based on the JSON parser by Patrick van Bergen
+ * http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
+ *
+ * Simplified it so that it doesn't throw exceptions
+ * and can be used in Unity iPhone with maximum code stripping.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+
+namespace MiniJSON {
+    // Example usage:
+    //
+    //  using UnityEngine;
+    //  using System.Collections;
+    //  using System.Collections.Generic;
+    //  using MiniJSON;
+    //
+    //  public class MiniJSONTest : MonoBehaviour {
+    //      void Start () {
+    //          var jsonString = "{ \"array\": [1.44,2,3], " +
+    //                          "\"object\": {\"key1\":\"value1\", \"key2\":256}, " +
+    //                          "\"string\": \"The quick brown fox \\\"jumps\\\" over the lazy dog \", " +
+    //                          "\"unicode\": \"\\u3041 Men\u00fa sesi\u00f3n\", " +
+    //                          "\"int\": 65536, " +
+    //                          "\"float\": 3.1415926, " +
+    //                          "\"bool\": true, " +
+    //                          "\"null\": null }";
+    //
+    //          var dict = Json.Deserialize(jsonString) as Dictionary<string,object>;
+    //
+    //          Debug.Log("deserialized: " + dict.GetType());
+    //          Debug.Log("dict['array'][0]: " + ((List<object>) dict["array"])[0]);
+    //          Debug.Log("dict['string']: " + (string) dict["string"]);
+    //          Debug.Log("dict['float']: " + (double) dict["float"]); // floats come out as doubles
+    //          Debug.Log("dict['int']: " + (long) dict["int"]); // ints come out as longs
+    //          Debug.Log("dict['unicode']: " + (string) dict["unicode"]);
+    //
+    //          var str = Json.Serialize(dict);
+    //
+    //          Debug.Log("serialized: " + str);
+    //      }
+    //  }
+
+    /// <summary>
+    /// This class encodes and decodes JSON strings.
+    /// Spec. details, see http://www.json.org/
+    ///
+    /// JSON uses Arrays and Objects. These correspond here to the datatypes IList and IDictionary.
+    /// All numbers are parsed to doubles.
+    /// </summary>
+    public static class Json {
+        /// <summary>
+        /// Parses the string json into a value
+        /// </summary>
+        /// <param name="json">A JSON string.</param>
+        /// <returns>An List&lt;object&gt;, a Dictionary&lt;string, object&gt;, a double, an integer,a string, null, true, or false</returns>
+        public static object Deserialize(string json) {
+            // save the string for debug information
+            if (json == null) {
+                return null;
+            }
+
+            return Parser.Parse(json);
+        }
+
+        sealed class Parser : IDisposable {
+            const string WORD_BREAK = "{}[],:\"";
+
+            public static bool IsWordBreak(char c) {
+                return Char.IsWhiteSpace(c) || WORD_BREAK.IndexOf(c) != -1;
+            }
+
+            const string HEX_DIGIT = "0123456789ABCDEFabcdef";
+
+            public static bool IsHexDigit(char c) {
+                return HEX_DIGIT.IndexOf(c) != -1;
+            }
+
+            enum TOKEN {
+                NONE,
+                CURLY_OPEN,
+                CURLY_CLOSE,
+                SQUARED_OPEN,
+                SQUARED_CLOSE,
+                COLON,
+                COMMA,
+                STRING,
+                NUMBER,
+                TRUE,
+                FALSE,
+                NULL
+            };
+
+            StringReader json;
+
+            Parser(string jsonString) {
+                json = new StringReader(jsonString);
+            }
+
+            public static object Parse(string jsonString) {
+                using (var instance = new Parser(jsonString)) {
+                    return instance.ParseValue();
+                }
+            }
+
+            public void Dispose() {
+                json.Dispose();
+                json = null;
+            }
+
+            Dictionary<string, object> ParseObject() {
+                Dictionary<string, object> table = new Dictionary<string, object>();
+
+                // ditch opening brace
+                json.Read();
+
+                // {
+                while (true) {
+                    switch (NextToken) {
+                    case TOKEN.NONE:
+                        return null;
+                    case TOKEN.COMMA:
+                        continue;
+                    case TOKEN.CURLY_CLOSE:
+                        return table;
+                    case TOKEN.STRING:
+                        // name
+                        string name = ParseString();
+                        if (name == null) {
+                            return null;
+                        }
+
+                        // :
+                        if (NextToken != TOKEN.COLON) {
+                            return null;
+                        }
+                        // ditch the colon
+                        json.Read();
+
+                        // value
+                        TOKEN valueToken = NextToken;
+                        object value = ParseByToken(valueToken);
+                        if(value==null && valueToken!=TOKEN.NULL)
+                            return null;
+                        table[name] = value;
+                        break;
+                    default:
+                        return null;
+                    }
+                }
+            }
+
+            List<object> ParseArray() {
+                List<object> array = new List<object>();
+
+                // ditch opening bracket
+                json.Read();
+
+                // [
+                var parsing = true;
+                while (parsing) {
+                    TOKEN nextToken = NextToken;
+
+                    switch (nextToken) {
+                    case TOKEN.NONE:
+                        return null;
+                    case TOKEN.COMMA:
+                        continue;
+                    case TOKEN.SQUARED_CLOSE:
+                        parsing = false;
+                        break;
+                    default:
+                        object value = ParseByToken(nextToken);
+                        if(value==null && nextToken!=TOKEN.NULL)
+                            return null;
+                        array.Add(value);
+                        break;
+                    }
+                }
+
+                return array;
+            }
+
+            object ParseValue() {
+                TOKEN nextToken = NextToken;
+                return ParseByToken(nextToken);
+            }
+
+            object ParseByToken(TOKEN token) {
+                switch (token) {
+                case TOKEN.STRING:
+                    return ParseString();
+                case TOKEN.NUMBER:
+                    return ParseNumber();
+                case TOKEN.CURLY_OPEN:
+                    return ParseObject();
+                case TOKEN.SQUARED_OPEN:
+                    return ParseArray();
+                case TOKEN.TRUE:
+                    return true;
+                case TOKEN.FALSE:
+                    return false;
+                case TOKEN.NULL:
+                    return null;
+                default:
+                    return null;
+                }
+            }
+
+            string ParseString() {
+                StringBuilder s = new StringBuilder();
+                char c;
+
+                // ditch opening quote
+                json.Read();
+
+                bool parsing = true;
+                while (parsing) {
+
+                    if (json.Peek() == -1) {
+                        parsing = false;
+                        break;
+                    }
+
+                    c = NextChar;
+                    switch (c) {
+                    case '"':
+                        parsing = false;
+                        break;
+                    case '\\':
+                        if (json.Peek() == -1) {
+                            parsing = false;
+                            break;
+                        }
+
+                        c = NextChar;
+                        switch (c) {
+                        case '"':
+                        case '\\':
+                        case '/':
+                            s.Append(c);
+                            break;
+                        case 'b':
+                            s.Append('\b');
+                            break;
+                        case 'f':
+                            s.Append('\f');
+                            break;
+                        case 'n':
+                            s.Append('\n');
+                            break;
+                        case 'r':
+                            s.Append('\r');
+                            break;
+                        case 't':
+                            s.Append('\t');
+                            break;
+                        case 'u':
+                            var hex = new char[4];
+
+                            for (int i=0; i< 4; i++) {
+                                hex[i] = NextChar;
+                                if (!IsHexDigit(hex[i]))
+                                    return null;
+                            }
+
+                            s.Append((char) Convert.ToInt32(new string(hex), 16));
+                            break;
+                        }
+                        break;
+                    default:
+                        s.Append(c);
+                        break;
+                    }
+                }
+
+                return s.ToString();
+            }
+
+            object ParseNumber() {
+                string number = NextWord;
+
+                if (number.IndexOf('.') == -1 && number.IndexOf('E') == -1 && number.IndexOf('e') == -1) {
+                    long parsedInt;
+                    Int64.TryParse(number, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out parsedInt);
+                    return parsedInt;
+                }
+
+                double parsedDouble;
+                Double.TryParse(number, System.Globalization.NumberStyles.Any, System.Globalization.CultureInfo.InvariantCulture, out parsedDouble);
+                return parsedDouble;
+            }
+
+            void EatWhitespace() {
+                while (Char.IsWhiteSpace(PeekChar)) {
+                    json.Read();
+
+                    if (json.Peek() == -1) {
+                        break;
+                    }
+                }
+            }
+
+            char PeekChar {
+                get {
+                    return Convert.ToChar(json.Peek());
+                }
+            }
+
+            char NextChar {
+                get {
+                    return Convert.ToChar(json.Read());
+                }
+            }
+
+            string NextWord {
+                get {
+                    StringBuilder word = new StringBuilder();
+
+                    while (!IsWordBreak(PeekChar)) {
+                        word.Append(NextChar);
+
+                        if (json.Peek() == -1) {
+                            break;
+                        }
+                    }
+
+                    return word.ToString();
+                }
+            }
+
+            TOKEN NextToken {
+                get {
+                    EatWhitespace();
+
+                    if (json.Peek() == -1) {
+                        return TOKEN.NONE;
+                    }
+
+                    switch (PeekChar) {
+                    case '{':
+                        return TOKEN.CURLY_OPEN;
+                    case '}':
+                        json.Read();
+                        return TOKEN.CURLY_CLOSE;
+                    case '[':
+                        return TOKEN.SQUARED_OPEN;
+                    case ']':
+                        json.Read();
+                        return TOKEN.SQUARED_CLOSE;
+                    case ',':
+                        json.Read();
+                        return TOKEN.COMMA;
+                    case '"':
+                        return TOKEN.STRING;
+                    case ':':
+                        return TOKEN.COLON;
+                    case '0':
+                    case '1':
+                    case '2':
+                    case '3':
+                    case '4':
+                    case '5':
+                    case '6':
+                    case '7':
+                    case '8':
+                    case '9':
+                    case '-':
+                        return TOKEN.NUMBER;
+                    }
+
+                    switch (NextWord) {
+                    case "false":
+                        return TOKEN.FALSE;
+                    case "true":
+                        return TOKEN.TRUE;
+                    case "null":
+                        return TOKEN.NULL;
+                    }
+
+                    return TOKEN.NONE;
+                }
+            }
+        }
+
+        /// <summary>
+        /// Converts a IDictionary / IList object or a simple type (string, int, etc.) into a JSON string
+        /// </summary>
+        /// <param name="obj">A Dictionary&lt;string, object&gt; / List&lt;object&gt;</param>
+        /// <returns>A JSON encoded string, or null if object 'json' is not serializable</returns>
+        public static string Serialize(object obj) {
+            return Serializer.Serialize(obj);
+        }
+
+        sealed class Serializer {
+            StringBuilder builder;
+
+            Serializer() {
+                builder = new StringBuilder();
+            }
+
+            public static string Serialize(object obj) {
+                var instance = new Serializer();
+
+                instance.SerializeValue(obj);
+
+                return instance.builder.ToString();
+            }
+
+            void SerializeValue(object value) {
+                IList asList;
+                IDictionary asDict;
+                string asStr;
+
+                if (value == null) {
+                    builder.Append("null");
+                } else if ((asStr = value as string) != null) {
+                    SerializeString(asStr);
+                } else if (value is bool) {
+                    builder.Append((bool) value ? "true" : "false");
+                } else if ((asList = value as IList) != null) {
+                    SerializeArray(asList);
+                } else if ((asDict = value as IDictionary) != null) {
+                    SerializeObject(asDict);
+                } else if (value is char) {
+                    SerializeString(new string((char) value, 1));
+                } else {
+                    SerializeOther(value);
+                }
+            }
+
+            void SerializeObject(IDictionary obj) {
+                bool first = true;
+
+                builder.Append('{');
+
+                foreach (object e in obj.Keys) {
+                    if (!first) {
+                        builder.Append(',');
+                    }
+
+                    SerializeString(e.ToString());
+                    builder.Append(':');
+
+                    SerializeValue(obj[e]);
+
+                    first = false;
+                }
+
+                builder.Append('}');
+            }
+
+            void SerializeArray(IList anArray) {
+                builder.Append('[');
+
+                bool first = true;
+
+                for (int i=0; i<anArray.Count; i++) {
+                    object obj = anArray[i];
+                    if (!first) {
+                        builder.Append(',');
+                    }
+
+                    SerializeValue(obj);
+
+                    first = false;
+                }
+
+                builder.Append(']');
+            }
+
+            void SerializeString(string str) {
+                builder.Append('\"');
+
+                char[] charArray = str.ToCharArray();
+                for (int i=0; i<charArray.Length; i++) {
+                    char c = charArray[i];
+                    switch (c) {
+                    case '"':
+                        builder.Append("\\\"");
+                        break;
+                    case '\\':
+                        builder.Append("\\\\");
+                        break;
+                    case '\b':
+                        builder.Append("\\b");
+                        break;
+                    case '\f':
+                        builder.Append("\\f");
+                        break;
+                    case '\n':
+                        builder.Append("\\n");
+                        break;
+                    case '\r':
+                        builder.Append("\\r");
+                        break;
+                    case '\t':
+                        builder.Append("\\t");
+                        break;
+                    default:
+                        int codepoint = Convert.ToInt32(c);
+                        if ((codepoint >= 32) && (codepoint <= 126)) {
+                            builder.Append(c);
+                        } else {
+                            builder.Append("\\u");
+                            builder.Append(codepoint.ToString("x4"));
+                        }
+                        break;
+                    }
+                }
+
+                builder.Append('\"');
+            }
+
+            void SerializeOther(object value) {
+                // NOTE: decimals lose precision during serialization.
+                // They always have, I'm just letting you know.
+                // Previously floats and doubles lost precision too.
+                if (value is float) {
+                    builder.Append(((float) value).ToString("R", System.Globalization.CultureInfo.InvariantCulture));
+                } else if (value is int
+                    || value is uint
+                    || value is long
+                    || value is sbyte
+                    || value is byte
+                    || value is short
+                    || value is ushort
+                    || value is ulong) {
+                    builder.Append(value);
+                } else if (value is double
+                    || value is decimal) {
+                    builder.Append(Convert.ToDouble(value).ToString("R", System.Globalization.CultureInfo.InvariantCulture));
+                } else {
+                    SerializeString(value.ToString());
+                }
+            }
+        }
+    }
+}

+ 11 - 0
GameClient/Assets/Game/Launcher/ReYunSDK/MiniJSON.cs.meta

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

+ 667 - 0
GameClient/Assets/Game/Launcher/ReYunSDK/Tracking.cs

@@ -0,0 +1,667 @@
+using UnityEngine;
+
+using System.Runtime.InteropServices;
+using AOT;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO;
+using System.Text.RegularExpressions;
+using System.Collections;
+
+public class Tracking: MonoBehaviour
+{
+	private static Tracking _instance = null;
+
+    //private static Regex regex = new Regex("^([a-zA-Z])([a-zA-Z0-9_]){0,63}$");
+
+    public static Tracking Instance {
+		get {
+			if (!_instance) {
+				_instance = FindObjectOfType (typeof(Tracking)) as Tracking;
+				if (!_instance) {
+					GameObject am = new GameObject ("Tracking");
+					_instance = am.AddComponent (typeof(Tracking)) as Tracking;
+				}
+			}
+			return _instance;           
+		}
+	}
+
+    private static List<Action> waitingTaskList = new List<Action>();
+
+    
+    private static List<Action> executingTaskList = new List<Action>();
+
+    public static void PostTask(Action task)
+    {
+        lock (waitingTaskList)
+        {
+            waitingTaskList.Add(task);
+        }
+    }
+
+    private void Update()
+    {
+        lock (waitingTaskList)
+        {
+            if (waitingTaskList.Count > 0)
+            {
+                executingTaskList.AddRange(waitingTaskList);
+
+                waitingTaskList.Clear();
+            }
+        }
+
+        for (int i = 0; i < executingTaskList.Count; ++i)
+        {
+            Action task = executingTaskList[i];
+            try
+            {
+                task();
+            }
+            catch (Exception e)
+            {
+                Debug.LogError(e.Message, this);
+            }
+        }
+
+        executingTaskList.Clear();
+    }
+
+
+
+    void Awake ()
+	{
+		DontDestroyOnLoad (this);
+	}
+
+    public delegate void DeferredDeeplinkCallBack(string result);
+
+    public delegate void AttributionCalllback(string result, int status);
+
+
+    private DeferredDeeplinkCallBack deferredDeeplinCallback_private = null;
+
+    private AttributionCalllback attributionCalllback_private = null;
+
+#if UNITY_IOS && !UNITY_EDITOR
+
+    internal delegate void _internalDeferredDeeplinkCallBack(string result);
+
+    internal delegate void _internalAttributionCalllback(string result, int status);
+
+    [DllImport ("__Internal")]
+	private static extern void _internalInitWithAppKeyAndChannel_Tracking (string appKey, string channelId);
+
+    [DllImport ("__Internal")]
+    private static extern void _preInit_newer (string appKey);
+
+    [DllImport ("__Internal")]
+    private static extern void _internalInitWithAppKeyAndChannel_Tracking_newer (string appKey, string channelId,string caid1,string caid2,string oid,string install_params,string startup_params);
+
+	[DllImport ("__Internal")]
+	private static extern void _internalSetRegisterWithAccountID_Tracking_newer (string account,string params_string);
+
+    [DllImport ("__Internal")]
+	private static extern void _internalSetLoginWithAccountIDAndServerId_Tracking_newer (string account,string serverId,string params_string);
+
+	[DllImport ("__Internal")]
+	private static extern void _internalSetRyzf_Tracking_newer (string ryTID, string ryzfType, string hbType, float hbAmount,string params_string);
+
+	[DllImport ("__Internal")]
+	private static extern void _internalSetDD_Tracking_newer (string ryTID, string hbType, float hbAmount,string params_string);
+
+	[DllImport ("__Internal")]
+	private static extern void _internalSetEvent_Tracking_newer (string EventName,string params_string);
+
+    [DllImport ("__Internal")]
+    private static extern void _internalSetTrackViewDuration_Tracking_newer (string viewID,long duration,string params_string);
+
+    [DllImport ("__Internal")]
+    private static extern void _internalSetAdShow_Tracking_newer(string adPlatform,string adid,int success,string params_string);
+
+    [DllImport ("__Internal")]
+    private static extern void _internalSetAdClick_Tracking_newer(string adPlatform,string adid,string params_string);
+
+    [DllImport ("__Internal")]
+    private static extern void _internalSetTrackAppDuration_Tracking_newer(long duration,string params_string);
+
+	[DllImport ("__Internal")]
+	private static extern string _internalGetDeviceId_Tracking ();
+
+	[DllImport ("__Internal")]
+	private static extern void _internalSetPrintLog_Tracking (bool printLog);
+
+    [DllImport ("__Internal")]
+	private static extern void _internalSetASAEnable_Tracking (bool enable);
+
+  
+
+    [DllImport("__Internal")]
+    private static extern void _internal_SetAttributionCalllbackDelegate_Tracing(_internalAttributionCalllback callback);
+
+    [DllImport("__Internal")]
+    private static extern void _internal_SetDeferredDeeplinkCallBack_Tracking(_internalDeferredDeeplinkCallBack callback);
+
+
+    [DllImport ("__Internal")]
+	private static extern void _internalSetIPAdds6Enable_Tracking (bool enable);
+#endif
+
+
+#if UNITY_ANDROID && !UNITY_EDITOR
+    public static AndroidJavaObject getApplicationContext ()
+	{
+		
+		using (AndroidJavaClass jc = new AndroidJavaClass ("com.unity3d.player.UnityPlayer")) {
+			using (AndroidJavaObject jo = jc.GetStatic<AndroidJavaObject> ("currentActivity")) {
+				return jo.Call<AndroidJavaObject> ("getApplicationContext");
+			}
+		}
+		
+		return null;
+	}
+#endif
+
+    /// <summary>
+    /// 预初始化方法   
+    /// </summary>
+    public void preInit(string appKey)
+    {
+
+#if UNITY_IOS && !UNITY_EDITOR
+      
+		_preInit_newer (appKey);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+        using (AndroidJavaClass TrackingIO = new AndroidJavaClass("com.reyun.tracking.sdk.Tracking"))
+        {
+            TrackingIO.CallStatic("preInit", getApplicationContext(), appKey);
+        }
+#else
+        Debug.LogError("Current platform not implemented!");
+#endif
+
+    }
+    /// <summary>
+    /// 初始化方法   
+    /// </summary>
+    /// <param name="appKey">appKey</param>
+    /// <param name="channelId">标识推广渠道的字符</param>
+    /// <param name="caid1">caid1 ios 专用字段,广告协会caid字段,默认为空</param>
+    /// <param name="caid2">caid2 ios 专用字段,广告协会caid字段,默认为空</param>
+    /// <param name="startupParams">自定义startup参数</param>
+    /// <param name="installParams">自定义install参数</param>
+    public void init (string appKey, string channelId,string caid1 = null,string caid2 = null,
+        Dictionary<string,object> startupParams = null, Dictionary<string, object> installParams = null)
+	{
+#if UNITY_IOS && !UNITY_EDITOR
+        string  paramstring_install = DictionaryToJsonString(installParams);
+        if (paramstring_install == null) {
+            paramstring_install = "{}";
+        }
+        string  paramstring_startup = DictionaryToJsonString(startupParams);
+        if (paramstring_startup == null) {
+            paramstring_startup = "{}";
+        }
+		_internalInitWithAppKeyAndChannel_Tracking_newer (appKey, channelId,caid1,caid2,null, paramstring_install,paramstring_startup);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+        string  paramstring_install = DictionaryToJsonString(installParams);
+        if (paramstring_install == null) {
+            paramstring_install = "{}";
+        }
+        string  paramstring_startup = DictionaryToJsonString(startupParams);
+        if (paramstring_startup == null) {
+            paramstring_startup = "{}";
+        }
+	    using (AndroidJavaClass TrackingIO = new AndroidJavaClass ("com.reyun.tracking.sdk.Tracking")) {
+		    TrackingIO.CallStatic ("initWithKeyAndChannelId", getApplicationContext (), appKey, channelId,paramstring_startup,paramstring_install,null,false);
+	    }
+#else
+        Debug.LogError("Current platform not implemented!");
+#endif
+    }
+
+    /// <summary>
+    /// 玩家服务器注册
+    /// </summary>
+    /// <param name="account">账号ID</param>
+    /// 
+    public void register (string account, Dictionary<string, object> customParams = null)
+	{
+#if UNITY_IOS && !UNITY_EDITOR
+        string paramstring = DictionaryToJsonString(customParams);
+		_internalSetRegisterWithAccountID_Tracking_newer(account,paramstring);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+        string  paramstring = DictionaryToJsonString(customParams);
+        if (paramstring == null) {
+            paramstring = "{}";
+        }
+		using (AndroidJavaClass TrackingIO = new AndroidJavaClass ("com.reyun.tracking.sdk.Tracking")) {
+			TrackingIO.CallStatic ("setRegisterWithAccountID", account,paramstring);
+		}
+#else
+        Debug.LogError("Current platform not implemented!");
+#endif
+
+    }
+
+    /// <summary>
+    /// 玩家的账号登陆服务器
+    /// </summary>
+    /// <param name="account">账号</param>
+    public void login (string account,string serverId = null, Dictionary<string, object> customParams = null)
+	{
+
+#if UNITY_IOS && !UNITY_EDITOR
+        string paramstring = DictionaryToJsonString(customParams);
+		_internalSetLoginWithAccountIDAndServerId_Tracking_newer (account,serverId,paramstring);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+        string  paramstring = DictionaryToJsonString(customParams);
+        if (paramstring == null) {
+            paramstring = "{}";
+        }
+		using (AndroidJavaClass TrackingIO = new AndroidJavaClass ("com.reyun.tracking.sdk.Tracking")) {
+			TrackingIO.CallStatic ("setLoginSuccessBusiness", account,serverId,paramstring);
+		}
+#else
+        Debug.LogError("Current platform not implemented!");
+#endif
+    }
+
+
+    /// <summary>
+    /// 玩家的充值数据
+    /// </summary>
+    /// <param name="ryTID">交易的流水号</param>
+    /// <param name="ryzfType">支付类型</param>
+    /// <param name="hbType">货币类型</param>
+    /// <param name="hbAmount">支付的真实货币的金额</param>
+    public void setryzf (string ryTID, string ryzfType, string hbType, float hbAmount, Dictionary<string, object> customParams = null)
+	{
+#if UNITY_IOS && !UNITY_EDITOR
+        string paramstring = DictionaryToJsonString(customParams);
+		_internalSetRyzf_Tracking_newer (ryTID, ryzfType, hbType, hbAmount,paramstring);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+        string  paramstring = DictionaryToJsonString(customParams);
+        if (paramstring == null) {
+            paramstring = "{}";
+        }
+		using (AndroidJavaClass TrackingIO = new AndroidJavaClass ("com.reyun.tracking.sdk.Tracking")) {
+		    TrackingIO.CallStatic ("setPayment", ryTID, ryzfType, hbType, hbAmount,paramstring);
+		}
+#else
+        Debug.LogError("Current platform not implemented!");
+#endif
+    }
+
+    /// <summary>
+    /// 玩家的订单数据
+    /// </summary>
+    /// <param name="ryTID">交易的流水号</param>
+    /// <param name="hbType">货币类型</param>
+    /// <param name="hbAmount">支付的真实货币的金额</param>
+	public void setDD (string ryTID, string hbType, float hbAmount, Dictionary<string, object> customParams = null)
+	{
+#if UNITY_IOS && !UNITY_EDITOR
+        string paramstring = DictionaryToJsonString(customParams);
+		_internalSetDD_Tracking_newer (ryTID,hbType,hbAmount,paramstring);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+        string  paramstring = DictionaryToJsonString(customParams);
+        if (paramstring == null) {
+            paramstring = "{}";
+        }
+		using (AndroidJavaClass TrackingIO = new AndroidJavaClass ("com.reyun.tracking.sdk.Tracking")) {
+		TrackingIO.CallStatic ("setOrder", ryTID, hbType, hbAmount,paramstring);
+		}
+#else
+        Debug.LogError("Current platform not implemented!");
+#endif
+    }
+
+    /// <summary>
+    /// 统计玩家的自定义事件
+    /// </summary>
+    /// <param name="eventName">事件名 必须为event_1到event_30</param>
+    public void setEvent (string eventName, Dictionary<string, object> customParams = null)
+	{
+#if UNITY_IOS && !UNITY_EDITOR
+        string paramstring = DictionaryToJsonString(customParams);
+		_internalSetEvent_Tracking_newer (eventName,paramstring);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+        string  paramstring = DictionaryToJsonString(customParams);
+        if (paramstring == null) {
+            paramstring = "{}";
+        }
+		using (AndroidJavaClass reyun = new AndroidJavaClass ("com.reyun.tracking.sdk.Tracking")) {
+			reyun.CallStatic ("setEvent", eventName, paramstring);
+		}
+#else
+        Debug.LogError("Current platform not implemented!");
+#endif
+    }
+
+    /// <summary>
+    /// 监测页面展示时长
+    /// </summary>
+    /// <param name="pageID">页面唯一标识</param>
+    /// <param name="duration">页面展示时长</param>
+    public void setTrackViewDuration(string pageID,long duration, Dictionary<string, object> customParams = null)
+    {
+#if UNITY_IOS && !UNITY_EDITOR
+        string paramstring = DictionaryToJsonString(customParams);
+        _internalSetTrackViewDuration_Tracking_newer(pageID,duration,paramstring);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+        string  paramstring = DictionaryToJsonString(customParams);
+        if (paramstring == null) {
+            paramstring = "{}";
+        }
+        using (AndroidJavaClass reyun = new AndroidJavaClass("com.reyun.tracking.sdk.Tracking"))
+        {
+            reyun.CallStatic("setPageDuration", pageID, duration*1000,paramstring);
+        }
+#else
+        Debug.LogError("Current platform not implemented!");
+#endif
+    }
+
+    /// <summary>
+    /// //广告展示时调用
+    /// </summary>
+    /// <param name="adPlatform">广告平台缩写,如穿山甲广告平台传入 "csj"</param>
+    /// <param name="adId">广告位ID</param>
+    /// /// <param name="playSuccess">是否展示成功</param>
+    public void setTrackAdShow(string adPlatform,string adId,bool playSuccess, Dictionary<string, object> customParams = null)
+    {
+#if UNITY_IOS && !UNITY_EDITOR
+        string paramstring = DictionaryToJsonString(customParams);
+        int successInt = playSuccess ? 1 : 2;
+        _internalSetAdShow_Tracking_newer(adPlatform,adId,successInt,paramstring);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+        string successString = playSuccess ? "1" : "2";
+        string  paramstring = DictionaryToJsonString(customParams);
+        if (paramstring == null) {
+            paramstring = "{}";
+        }
+        using (AndroidJavaClass reyun = new AndroidJavaClass("com.reyun.tracking.sdk.Tracking"))
+        {
+            reyun.CallStatic("setAdShow", adPlatform, adId,successString,paramstring);
+        }
+#else
+        Debug.LogError("Current platform not implemented!");
+#endif
+    }
+
+    /// <summary>
+    /// //广告点击时调用
+    /// </summary>
+    /// <param name="adPlatform">广告平台缩写,如穿山甲广告平台传入 "csj"</param>
+    /// <param name="adId">广告位ID</param>
+    public void setTrackAdClick(string adPlatform, string adId, Dictionary<string, object> customParams = null)
+    {
+       
+#if UNITY_IOS && !UNITY_EDITOR
+        string paramstring = DictionaryToJsonString(customParams);
+        _internalSetAdClick_Tracking_newer(adPlatform,adId,paramstring);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+        string  paramstring = DictionaryToJsonString(customParams);
+        if (paramstring == null) {
+            paramstring = "{}";
+        }
+        using (AndroidJavaClass reyun = new AndroidJavaClass("com.reyun.tracking.sdk.Tracking"))
+        {
+            reyun.CallStatic("setAdClick", adPlatform, adId,paramstring);
+        }
+#else
+        Debug.LogError("Current platform not implemented!");
+#endif
+    }
+
+    /// <summary>
+    /// 统计APP运行时长
+    /// </summary>
+    /// <param name="duration">时间长度</param>
+    public void setTrackAppDuration(long duration, Dictionary<string, object> customParams = null)
+    {
+#if UNITY_IOS && !UNITY_EDITOR
+        string paramstring = DictionaryToJsonString(customParams);
+        _internalSetTrackAppDuration_Tracking_newer(duration,paramstring);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+        string  paramstring = DictionaryToJsonString(customParams);
+        if (paramstring == null) {
+            paramstring = "{}";
+        }
+        using (AndroidJavaClass reyun = new AndroidJavaClass("com.reyun.tracking.sdk.Tracking"))
+        {
+            reyun.CallStatic("setAppDuration", duration*1000,paramstring);
+        }
+#else
+        Debug.LogError("Current platform not implemented!");
+#endif
+    }
+
+
+
+    /// <summary>
+    /// 获取用户的设备ID信息
+    /// </summary>
+    public string getDeviceId ()
+	{
+#if UNITY_IOS && !UNITY_EDITOR
+		return _internalGetDeviceId_Tracking ();
+#elif UNITY_ANDROID && !UNITY_EDITOR
+		string str = "unknown";
+
+		using (AndroidJavaClass TrackingIO = new AndroidJavaClass ("com.reyun.tracking.sdk.Tracking")) {
+			str = TrackingIO.CallStatic<string> ("getDeviceId");
+		}
+		return str;
+#else
+        Debug.LogError("Current platform not implemented!");
+        return "unknown";
+#endif
+    }
+
+	/// 开启日志打印
+	public void setPrintLog (bool print)
+	{
+#if UNITY_IOS && !UNITY_EDITOR
+		_internalSetPrintLog_Tracking (print);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+	  using (AndroidJavaClass TrackingIO = new AndroidJavaClass ("com.reyun.tracking.sdk.Tracking")) {
+	        TrackingIO.CallStatic("setDebugMode", print);
+	  }
+#else
+        Debug.LogError("Current platform not implemented!");
+#endif
+    }
+
+    public void setASAEnable(bool enable)
+    {
+#if UNITY_IOS && !UNITY_EDITOR
+		_internalSetASAEnable_Tracking (enable);
+#else
+        Debug.LogError("Current platform not implemented!");
+#endif
+    }
+
+
+#if UNITY_IOS && !UNITY_EDITOR
+    [MonoPInvokeCallback(typeof(_internalDeferredDeeplinkCallBack))]
+    private static void OnDeeplinkCallback(string msg)
+    {
+        PostTask(() =>
+        {
+            if (Tracking.Instance.deferredDeeplinCallback_private != null && msg != null)
+            {
+                Tracking.Instance.deferredDeeplinCallback_private.Invoke(msg);
+            }
+        });
+    }
+
+    [MonoPInvokeCallback(typeof(_internalAttributionCalllback))]
+    private static void OnAttibutionCallback(string result, int status)
+    {
+        PostTask(() =>
+        {
+            if (Tracking.Instance.attributionCalllback_private != null)
+            {
+                Tracking.Instance.attributionCalllback_private.Invoke(result, status);
+            }
+        });
+    }
+#endif
+
+    #region iOS install Attribution 
+    public void setAttributionCalllbackDelegate(AttributionCalllback callback)
+    {
+#if UNITY_IOS && !UNITY_EDITOR
+        Tracking.Instance.attributionCalllback_private = callback;
+        _internal_SetAttributionCalllbackDelegate_Tracing(OnAttibutionCallback);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+        Tracking.Instance.attributionCalllback_private = callback;
+        using (AndroidJavaClass TrackingIO = new AndroidJavaClass("com.reyun.tracking.sdk.Tracking"))
+        {
+            TrackingIO.CallStatic("setAttributionQueryListener", new AndroidAttributionQuery());
+        }
+#else
+        Debug.LogError("Current platform not implemented!");
+#endif
+    }
+    #endregion
+
+    #region iOS deferred deeplink 
+    public void setDeferredDeeplinkCalllbackDelegate(DeferredDeeplinkCallBack callback)
+    {
+#if UNITY_IOS && !UNITY_EDITOR
+        Tracking.Instance.deferredDeeplinCallback_private = callback;
+        _internal_SetDeferredDeeplinkCallBack_Tracking(OnDeeplinkCallback);
+#elif UNITY_ANDROID && !UNITY_EDITOR
+        Tracking.Instance.deferredDeeplinCallback_private = callback;
+        using (AndroidJavaClass TrackingIO = new AndroidJavaClass("com.reyun.tracking.sdk.Tracking"))
+        {
+            TrackingIO.CallStatic("setDeepLinkListener", new AndroidDeferredDeeplink());
+        }
+#else
+        Debug.LogError("Current platform not implemented!");
+#endif
+    }
+    #endregion
+
+
+#if UNITY_ANDROID && !UNITY_EDITOR
+    private sealed class AndroidAttributionQuery : AndroidJavaProxy {
+
+        public AndroidAttributionQuery() : base("com.reyun.tracking.utils.IAttributionQueryListener")
+        {
+        }
+        public void onComplete(int paramInt, String param_string) {
+            Tracking.PostTask(() =>
+            {
+                if (Tracking.Instance.attributionCalllback_private != null)
+                {
+                    Tracking.Instance.attributionCalllback_private.Invoke(param_string, paramInt);
+                }
+            });
+        }
+    
+    }
+
+    private sealed class AndroidDeferredDeeplink : AndroidJavaProxy
+    {
+
+        public AndroidDeferredDeeplink() : base("com.reyun.tracking.utils.IDeepLinkListener")
+        {
+        }
+        public void onComplete(bool isSuccess, String dpUrl, String dpPath)
+        {
+            Tracking.PostTask(() =>
+            {
+                if (Tracking.Instance.deferredDeeplinCallback_private != null)
+                {
+                    string jsonString = "";
+                    if (isSuccess)
+                    {
+                        jsonString += "{\"dp_url\":\"" + (dpUrl != null? dpUrl : "") + "\",";
+                        jsonString += "\"dp_path\":\"" + (dpPath != null ? dpPath : "") + "\"}";
+                    }
+                    else
+                    {
+                        jsonString = "{}";
+                    }
+                    Tracking.Instance.deferredDeeplinCallback_private.Invoke(jsonString);
+                }
+            });
+
+        }
+
+    }
+#endif
+
+    private static String DictionaryToJsonString (Dictionary<string, object> dictionary)
+    {
+        string result = null;
+        try
+        {
+            if (!CheckDictionary(dictionary)) {
+                return result;
+            }
+            result = MiniJSON.Json.Serialize(dictionary);
+        }
+        catch (Exception e)
+        {
+            Debug.LogError("ToJsonString error:" + e.Message);
+        }
+        return result;
+    }
+
+    private static bool CheckDictionary(Dictionary<string, object> dictionary)
+    {
+        if (dictionary == null || dictionary.Count == 0)
+        {
+            return false;
+        }
+        foreach (var entry in dictionary)
+        {
+            if (entry.Key == null)
+            {
+                return false;
+            }
+            if (entry.Value == null)
+            {
+                return false;
+            }
+            if (entry.Value is string stringvalue)
+            {
+                if (stringvalue == null || stringvalue.Length == 0)
+                {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    //private static bool isNumber(object value)
+    //{
+    //    if (value == null)
+    //    {
+    //        return false;
+    //    }
+    //    if (value is float || value is int
+    //                || value is uint
+    //                || value is long
+    //                || value is sbyte
+    //                || value is byte
+    //                || value is short
+    //                || value is ushort
+    //                || value is ulong
+    //                || value is double
+    //                || value is decimal)
+    //    {
+    //        return true;
+    //    }
+    //    return false;
+    //}
+}
+

+ 11 - 0
GameClient/Assets/Game/Launcher/ReYunSDK/Tracking.cs.meta

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

BIN
GameClient/Assets/Plugins/.DS_Store


+ 20 - 21
GameClient/Assets/Plugins/NativeGallery/iOS/NativeGallery.mm.meta

@@ -1,33 +1,32 @@
 fileFormatVersion: 2
 guid: 953e0b740eb03144883db35f72cad8a6
-timeCreated: 1498722774
-licenseType: Store
 PluginImporter:
+  externalObjects: {}
   serializedVersion: 2
   iconMap: {}
   executionOrder: {}
+  defineConstraints: []
   isPreloaded: 0
   isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
   platformData:
-    data:
-      first:
-        Any: 
-      second:
-        enabled: 0
-        settings: {}
-    data:
-      first:
-        Editor: Editor
-      second:
-        enabled: 0
-        settings:
-          DefaultValueInitialized: true
-    data:
-      first:
-        iPhone: iOS
-      second:
-        enabled: 1
-        settings: {}
+  - first:
+      Any: 
+    second:
+      enabled: 0
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      iPhone: iOS
+    second:
+      enabled: 1
+      settings: {}
   userData: 
   assetBundleName: 
   assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d151cd60caba549248280692b3bf42e2
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 44 - 0
GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/Info.plist

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>AvailableLibraries</key>
+	<array>
+		<dict>
+			<key>BinaryPath</key>
+			<string>TrackingIOSDK.framework/TrackingIOSDK</string>
+			<key>LibraryIdentifier</key>
+			<string>ios-arm64_x86_64-simulator</string>
+			<key>LibraryPath</key>
+			<string>TrackingIOSDK.framework</string>
+			<key>SupportedArchitectures</key>
+			<array>
+				<string>arm64</string>
+				<string>x86_64</string>
+			</array>
+			<key>SupportedPlatform</key>
+			<string>ios</string>
+			<key>SupportedPlatformVariant</key>
+			<string>simulator</string>
+		</dict>
+		<dict>
+			<key>BinaryPath</key>
+			<string>TrackingIOSDK.framework/TrackingIOSDK</string>
+			<key>LibraryIdentifier</key>
+			<string>ios-arm64</string>
+			<key>LibraryPath</key>
+			<string>TrackingIOSDK.framework</string>
+			<key>SupportedArchitectures</key>
+			<array>
+				<string>arm64</string>
+			</array>
+			<key>SupportedPlatform</key>
+			<string>ios</string>
+		</dict>
+	</array>
+	<key>CFBundlePackageType</key>
+	<string>XFWK</string>
+	<key>XCFrameworkFormatVersion</key>
+	<string>1.0</string>
+</dict>
+</plist>

+ 7 - 0
GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/Info.plist.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: d456ae79781dc4c5fa4056728482e384
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 52e83a93072ba43b1a0f24dd002cddb0
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 34 - 0
GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework.meta

@@ -0,0 +1,34 @@
+fileFormatVersion: 2
+guid: 2950fb3170da845b49cbb35eb1fc70ca
+folderAsset: yes
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 0
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      iPhone: iOS
+    second:
+      enabled: 1
+      settings:
+        AddToEmbeddedBinaries: false
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Headers.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 416d3bbe532c74f32b08331d4584f3eb
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 77 - 0
GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Headers/Tracking.h

@@ -0,0 +1,77 @@
+//
+//  Tracking.h
+//  ReYun_Tracking
+//
+//  Created by jesse on 2018/1/19.
+//  Copyright © 2018年 yun. All rights reserved.
+//
+#define REYUN_TRACKING_VERSION @"1.9.17"
+#import <Foundation/Foundation.h>
+NS_ASSUME_NONNULL_BEGIN
+
+//deeplink callback 代理
+@protocol DeferredDeeplinkCalllback <NSObject>
+@required
+- (void)onDeferredDeeplinkCalllback:(NSDictionary *)params;
+@end
+
+//激活归因回调代理
+@protocol OnAttributionCallbackProtocol <NSObject>
+@required
+- (void)OnAttribution:(nullable NSString *)result status:(NSUInteger)httpStatus;
+@end
+
+
+@interface Tracking : NSObject
+
+//开启打印日志(在initWithAppKey:withChannelId:前调用)
+//正式上线包请关掉
++(void) setPrintLog :(BOOL)print;
+//是否开启ASA归因查询,主动调用传入true开启,默认关闭(在initWithAppKey:withChannelId:前调用)
++(void) setASAEnable :(BOOL)enable;
+
++(void)preInit:(NSString *)appKey;
+/// 开启数据统计
+/// @param appKey 热云TrackingIO apppkey TrackingIO后台获取  必填
+/// @param channelId 热云TrackingIO channelId  固定值@"_default_"
+/// @param caid  客户自行传入参数  没有caid需求可为空 传入 nil
+/// @param caid2  客户自行传入参数  没有caid2需求可为空 传入 nil
+/// @param installParams 自定义install参数
+/// @param startupParams 自定义startup参数
++ (void)initWithAppKey:(NSString *)appKey withChannelId:(NSString *)channelId withCAID:(nullable NSString *)caid
+ withCAID2:(nullable NSString *)caid2  withInstallParams:(nullable NSDictionary *)installParams withStartupParams:(nullable NSDictionary *)startupParams;
+//注册成功后调用
++ (void)setRegisterWithAccountID:(NSString *)account withParams:(nullable NSDictionary *)customParams;
+//登陆成功后调用
++ (void)setLoginWithAccountID:(NSString *)account withParams:(nullable NSDictionary *)customParams;
+//生成订单
++(void)setDD:(NSString *)ryTID hbType:(NSString*)hbType hbAmount:(float)hbAmount withParams:(nullable NSDictionary *)customParams;
+// 支付完成,付费分析,记录玩家充值的金额(人民币单位是元)
++(void)setRyzf:(NSString *)ryTID ryzfType:(NSString*)ryzfType hbType:(NSString*)hbType hbAmount:(float)hbAmount withParams:(nullable NSDictionary *)customParams;
+//广告展示时调用 playSuccess 参数调用广告填充成功时传1  不成功时传2
++(void)onAdShow:(NSString *)adPlatform adId:(NSString *)adId isSuccess:(int)playSuccess withParams:(nullable NSDictionary *)customParams;
+//广告点击时调用
++(void)onAdClick:(NSString *)adPlatform adId:(NSString *)adId withParams:(nullable NSDictionary *)customParams;
+//页面时长监测
++(void)trackViewName:(NSString *)pageID duration:(long)duration withParams:(nullable NSDictionary *)customParams;
+//APP使用时长监测
++(void)setTrackAppDuration:(long)duration withParams:(nullable NSDictionary *)customParams;
+//自定义事件
++(void)setEvent:(NSString *)eventName param:(nullable NSDictionary *)customParams;
+//获取设备信息
++(NSString*)getDeviceId;
+
+@end
+
+@interface Tracking(DeepLink)
+//延迟深度链接回调代理设置
++(void)setDeferredDeeplinkCalllbackDelegate:(id<DeferredDeeplinkCalllback>) delegate ;
+@end
+
+@interface Tracking(Attribution)
+//激活归因回调代理设置
++(void)setAttributionCalllbackDelegate:(id<OnAttributionCallbackProtocol>) delegate ;
+@end
+
+
+NS_ASSUME_NONNULL_END

+ 7 - 0
GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Headers/Tracking.h.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 6552cb39cd33f47fda7ce9f11d4f7aac
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Info.plist


+ 7 - 0
GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Info.plist.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: e035434f16942412db281ba9852c647d
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Modules.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f3845919f75ce45629c579b6e0762ed1
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 30 - 0
GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Modules/module.modulemap

@@ -0,0 +1,30 @@
+framework module TrackingIOSDK {
+    umbrella header "Tracking.h"
+
+    export *
+ 
+    module * {
+         export *
+     }
+
+    link framework "AdSupport"
+    link framework "CoreTelephony"
+    link framework "Security"
+    link framework "StoreKit"//to be removed
+    link framework "AdServices"//optional
+    link framework "SystemConfiguration"
+    link framework "AVFoundation"
+    link framework "CFNetwork"
+    link framework "Foundation"
+    link framework "WebKit"
+
+    link "z"
+    link "sqlite3"
+    link "resolv.9"
+    link "resolv"
+    link "c++"
+    link "z"
+
+
+}
+

+ 7 - 0
GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/Modules/module.modulemap.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 08df21f0bb54442d89cc00fe472df13e
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/TrackingIOSDK


+ 7 - 0
GameClient/Assets/Plugins/iOS/TrackingIOSDK.xcframework/ios-arm64/TrackingIOSDK.framework/TrackingIOSDK.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 907d6db334ce94b52931fb53ab2262e6
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: