public static void AnalyticsWakeApp(string mode, string id = null, string type = null, string subtype = null)
        {
            if (Application.isEditor)
            {
                return;
            }

            var userId = UserInfoManager.isLogin() ? UserInfoManager.initUserInfo().userId : null;
            var device = deviceId() + (SystemInfo.deviceModel ?? "");
            var data   = new List <Dictionary <string, string> >();

            if (id.isNotEmpty())
            {
                data.Add(new Dictionary <string, string> {
                    { "key", "id" }, { "dataType", "string" }, { "value", id }
                });
            }

            if (type.isNotEmpty())
            {
                data.Add(new Dictionary <string, string> {
                    { "key", "type" }, { "dataType", "string" }, { "value", type }
                });
            }

            if (subtype.isNotEmpty())
            {
                data.Add(new Dictionary <string, string> {
                    { "key", "subtype" }, { "dataType", "string" }, { "value", subtype }
                });
            }

            AnalyticsApi.AnalyticsApp(userId, device, mode, DateTime.UtcNow, data);
        }
        public static void AnalyticsLogin(string type, string userId)
        {
            if (Application.isEditor)
            {
                return;
            }

            var device = deviceId() + (SystemInfo.deviceModel ?? "");
            var data   = new List <Dictionary <string, string> > {
                new Dictionary <string, string> {
                    { "key", "type" }, { "dataType", "string" }, { "value", type }
                }
            };

            AnalyticsApi.AnalyticsApp(userId, device, "UserLogin", DateTime.UtcNow, data);
        }
        public static void AnalyticsClickEgg(int index)
        {
            if (Application.isEditor)
            {
                return;
            }

            var userId = UserInfoManager.isLogin() ? UserInfoManager.initUserInfo().userId : null;
            var device = deviceId() + (SystemInfo.deviceModel ?? "");
            var data   = new List <Dictionary <string, string> > {
                new Dictionary <string, string> {
                    { "key", "index" }, { "dataType", "int" }, { "value", index.ToString() }
                }
            };

            AnalyticsApi.AnalyticsApp(userId, device, "ClickEgg", DateTime.UtcNow, data);
        }
        public static void AnalyticsOpenApp()
        {
            if (Application.isEditor)
            {
                return;
            }

            var type   = "OpenApp";
            var userId = UserInfoManager.isLogin() ? UserInfoManager.initUserInfo().userId : null;
            var device = deviceId() + (SystemInfo.deviceModel ?? "");
            var data   = new List <Dictionary <string, string> > {
                new Dictionary <string, string> {
                    { "key", "enableNotification" }, { "dataType", "bool" }, { "value", enableNotification().ToString() }
                }
            };

            AnalyticsApi.AnalyticsApp(userId, device, type, DateTime.UtcNow, data);
        }
Esempio n. 5
0
        public static void AnalyticsQRScan(QRState state, bool success = true)
        {
            if (Application.isEditor)
            {
                return;
            }

            var userId = UserInfoManager.isLogin() ? UserInfoManager.initUserInfo().userId : null;
            var device = deviceId() + (SystemInfo.deviceModel ?? "");
            var data   = new List <Dictionary <string, string> > {
                new Dictionary <string, string> {
                    { "key", "state" }, { "dataType", "string" }, { "value", state.ToString() }
                },
                new Dictionary <string, string> {
                    { "key", "success" }, { "dataType", "bool" }, { "value", success.ToString() }
                }
            };

            AnalyticsApi.AnalyticsApp(userId, device, "QRScan", DateTime.UtcNow, data);
        }