Example #1
0
        public static AnalyticsResult CustomEvent(string customEventName, Vector3 position)
        {
            bool flag = string.IsNullOrEmpty(customEventName);

            if (flag)
            {
                throw new ArgumentException("Cannot set custom event name to an empty or null string");
            }
            bool            flag2 = !Analytics.IsInitialized();
            AnalyticsResult result;

            if (flag2)
            {
                result = AnalyticsResult.NotInitialized;
            }
            else
            {
                CustomEventData customEventData = new CustomEventData(customEventName);
                customEventData.AddDouble("x", (double)Convert.ToDecimal(position.x));
                customEventData.AddDouble("y", (double)Convert.ToDecimal(position.y));
                customEventData.AddDouble("z", (double)Convert.ToDecimal(position.z));
                AnalyticsResult analyticsResult = Analytics.SendCustomEvent(customEventData);
                customEventData.Dispose();
                result = analyticsResult;
            }
            return(result);
        }
Example #2
0
        public static AnalyticsResult SetEventEndPoint(string eventName, string endPoint, int ver = 1, string prefix = "")
        {
            bool flag = string.IsNullOrEmpty(eventName);

            if (flag)
            {
                throw new ArgumentException("Cannot set event name to an empty or null string");
            }
            bool flag2 = endPoint == null;

            if (flag2)
            {
                throw new ArgumentException("Cannot set parameters to null");
            }
            bool            flag3 = !Analytics.IsInitialized();
            AnalyticsResult result;

            if (flag3)
            {
                result = AnalyticsResult.NotInitialized;
            }
            else
            {
                result = Analytics.SetEventWithLimitEndPoint(eventName, endPoint, ver, prefix);
            }
            return(result);
        }
Example #3
0
        public static AnalyticsResult FlushEvents()
        {
            bool            flag = !Analytics.IsInitialized();
            AnalyticsResult result;

            if (flag)
            {
                result = AnalyticsResult.NotInitialized;
            }
            else
            {
                result = (Analytics.FlushArchivedEvents() ? AnalyticsResult.Ok : AnalyticsResult.NotInitialized);
            }
            return(result);
        }
Example #4
0
        public static AnalyticsResult ResumeInitialization()
        {
            bool            flag = !Analytics.IsInitialized();
            AnalyticsResult result;

            if (flag)
            {
                result = AnalyticsResult.NotInitialized;
            }
            else
            {
                result = Analytics.ResumeInitializationInternal();
            }
            return(result);
        }
Example #5
0
        private static AnalyticsResult SendUserInfoEvent(object param)
        {
            bool            flag = !Analytics.IsInitialized();
            AnalyticsResult result;

            if (flag)
            {
                result = AnalyticsResult.NotInitialized;
            }
            else
            {
                Analytics.QueueEvent("userInfo", param, 1, string.Empty);
                result = AnalyticsResult.Ok;
            }
            return(result);
        }
Example #6
0
        public static AnalyticsResult IsEventEnabled(string eventName, int ver = 1, string prefix = "")
        {
            bool flag = string.IsNullOrEmpty(eventName);

            if (flag)
            {
                throw new ArgumentException("Cannot set event name to an empty or null string");
            }
            bool            flag2 = !Analytics.IsInitialized();
            AnalyticsResult result;

            if (flag2)
            {
                result = AnalyticsResult.NotInitialized;
            }
            else
            {
                result = Analytics.IsEventWithLimitEnabled(eventName, ver, prefix);
            }
            return(result);
        }
Example #7
0
        private static AnalyticsResult RegisterEvent(string eventName, int maxEventPerHour, int maxItems, string vendorKey, int ver, string prefix, string assemblyInfo)
        {
            bool flag = string.IsNullOrEmpty(eventName);

            if (flag)
            {
                throw new ArgumentException("Cannot set event name to an empty or null string");
            }
            bool            flag2 = !Analytics.IsInitialized();
            AnalyticsResult result;

            if (flag2)
            {
                result = AnalyticsResult.NotInitialized;
            }
            else
            {
                result = Analytics.RegisterEventWithLimit(eventName, maxEventPerHour, maxItems, vendorKey, ver, prefix, assemblyInfo, true);
            }
            return(result);
        }
Example #8
0
        public static AnalyticsResult EnableCustomEvent(string customEventName, bool enabled)
        {
            bool flag = string.IsNullOrEmpty(customEventName);

            if (flag)
            {
                throw new ArgumentException("Cannot set event name to an empty or null string");
            }
            bool            flag2 = !Analytics.IsInitialized();
            AnalyticsResult result;

            if (flag2)
            {
                result = AnalyticsResult.NotInitialized;
            }
            else
            {
                result = Analytics.EnableCustomEventWithLimit(customEventName, enabled);
            }
            return(result);
        }
Example #9
0
        public static AnalyticsResult CustomEvent(string customEventName, IDictionary <string, object> eventData)
        {
            bool flag = string.IsNullOrEmpty(customEventName);

            if (flag)
            {
                throw new ArgumentException("Cannot set custom event name to an empty or null string");
            }
            bool            flag2 = !Analytics.IsInitialized();
            AnalyticsResult result;

            if (flag2)
            {
                result = AnalyticsResult.NotInitialized;
            }
            else
            {
                bool flag3 = eventData == null;
                if (flag3)
                {
                    result = Analytics.SendCustomEventName(customEventName);
                }
                else
                {
                    CustomEventData customEventData = new CustomEventData(customEventName);
                    AnalyticsResult analyticsResult = AnalyticsResult.InvalidData;
                    try
                    {
                        customEventData.AddDictionary(eventData);
                        analyticsResult = Analytics.SendCustomEvent(customEventData);
                    }
                    finally
                    {
                        customEventData.Dispose();
                    }
                    result = analyticsResult;
                }
            }
            return(result);
        }
Example #10
0
        public static AnalyticsResult Transaction(string productId, decimal amount, string currency, string receiptPurchaseData, string signature, bool usingIAPService)
        {
            bool flag = string.IsNullOrEmpty(productId);

            if (flag)
            {
                throw new ArgumentException("Cannot set productId to an empty or null string");
            }
            bool flag2 = string.IsNullOrEmpty(currency);

            if (flag2)
            {
                throw new ArgumentException("Cannot set currency to an empty or null string");
            }
            bool            flag3 = !Analytics.IsInitialized();
            AnalyticsResult result;

            if (flag3)
            {
                result = AnalyticsResult.NotInitialized;
            }
            else
            {
                bool flag4 = receiptPurchaseData == null;
                if (flag4)
                {
                    receiptPurchaseData = string.Empty;
                }
                bool flag5 = signature == null;
                if (flag5)
                {
                    signature = string.Empty;
                }
                result = Analytics.Transaction(productId, Convert.ToDouble(amount), currency, receiptPurchaseData, signature, usingIAPService);
            }
            return(result);
        }
Example #11
0
 internal static bool IsInitialized()
 {
     return(Analytics.IsInitialized());
 }