public static AnalyticsResult Transaction(string productId, decimal amount, string currency, string receiptPurchaseData, string signature, bool usingIAPService) { if (string.IsNullOrEmpty(productId)) { throw new ArgumentException("Cannot set productId to an empty or null string"); } if (string.IsNullOrEmpty(currency)) { throw new ArgumentException("Cannot set currency to an empty or null string"); } UnityAnalyticsHandler unityAnalyticsHandler = GetUnityAnalyticsHandler(); if (unityAnalyticsHandler == null) { return(AnalyticsResult.NotInitialized); } if (receiptPurchaseData == null) { receiptPurchaseData = string.Empty; } if (signature == null) { signature = string.Empty; } return(unityAnalyticsHandler.Transaction(productId, Convert.ToDouble(amount), currency, receiptPurchaseData, signature, usingIAPService)); }
public static AnalyticsResult CustomEvent(string customEventName, IDictionary <string, object> eventData) { if (string.IsNullOrEmpty(customEventName)) { throw new ArgumentException("Cannot set custom event name to an empty or null string"); } UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler(); AnalyticsResult result; if (unityAnalyticsHandler == null) { result = AnalyticsResult.NotInitialized; } else if (eventData == null) { result = unityAnalyticsHandler.CustomEvent(customEventName); } else { CustomEventData customEventData = new CustomEventData(customEventName); customEventData.Add(eventData); result = unityAnalyticsHandler.CustomEvent(customEventData); } return(result); }
internal static UnityAnalyticsHandler GetUnityAnalyticsHandler() { if (s_UnityAnalyticsHandler == null) { s_UnityAnalyticsHandler = new UnityAnalyticsHandler(); } return(s_UnityAnalyticsHandler); }
public static AnalyticsResult SetUserBirthYear(int birthYear) { UnityAnalyticsHandler unityAnalyticsHandler = GetUnityAnalyticsHandler(); if (s_UnityAnalyticsHandler == null) { return(AnalyticsResult.NotInitialized); } return(unityAnalyticsHandler.SetUserBirthYear(birthYear)); }
public static AnalyticsResult Transaction(string productId, decimal amount, string currency) { UnityAnalyticsHandler unityAnalyticsHandler = GetUnityAnalyticsHandler(); if (unityAnalyticsHandler == null) { return(AnalyticsResult.NotInitialized); } return(unityAnalyticsHandler.Transaction(productId, Convert.ToDouble(amount), currency, null, null)); }
public static AnalyticsResult SetUserGender(Gender gender) { UnityAnalyticsHandler unityAnalyticsHandler = GetUnityAnalyticsHandler(); if (unityAnalyticsHandler == null) { return(AnalyticsResult.NotInitialized); } return(unityAnalyticsHandler.SetUserGender(gender)); }
public static AnalyticsResult Transaction(string productId, decimal amount, string currency, string receiptPurchaseData, string signature) { UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler(); if (unityAnalyticsHandler == null) { return(AnalyticsResult.NotInitialized); } return(unityAnalyticsHandler.Transaction(productId, Convert.ToDouble(amount), currency, receiptPurchaseData, signature)); }
public static AnalyticsResult FlushEvents() { UnityAnalyticsHandler unityAnalyticsHandler = GetUnityAnalyticsHandler(); if (unityAnalyticsHandler == null) { return(AnalyticsResult.NotInitialized); } return(unityAnalyticsHandler.FlushEvents() ? AnalyticsResult.Ok : AnalyticsResult.NotInitialized); }
internal static UnityAnalyticsHandler GetUnityAnalyticsHandler() { if (s_UnityAnalyticsHandler == null) { s_UnityAnalyticsHandler = new UnityAnalyticsHandler(); } if (s_UnityAnalyticsHandler.IsInitialized()) { return(s_UnityAnalyticsHandler); } return(null); }
public static AnalyticsResult SetUserId(string userId) { if (string.IsNullOrEmpty(userId)) { throw new ArgumentException("Cannot set userId to an empty or null string"); } UnityAnalyticsHandler unityAnalyticsHandler = GetUnityAnalyticsHandler(); if (unityAnalyticsHandler == null) { return(AnalyticsResult.NotInitialized); } return(unityAnalyticsHandler.SetUserId(userId)); }
private static AnalyticsResult RegisterEvent(string eventName, int maxEventPerHour, int maxItems, string vendorKey, int ver, string prefix, string assemblyInfo) { if (string.IsNullOrEmpty(eventName)) { throw new ArgumentException("Cannot set event name to an empty or null string"); } UnityAnalyticsHandler unityAnalyticsHandler = GetUnityAnalyticsHandler(); if (unityAnalyticsHandler == null) { return(AnalyticsResult.NotInitialized); } return(unityAnalyticsHandler.RegisterEvent(eventName, maxEventPerHour, maxItems, vendorKey, ver, prefix, assemblyInfo)); }
public static AnalyticsResult CustomEvent(string customEventName) { if (string.IsNullOrEmpty(customEventName)) { throw new ArgumentException("Cannot set custom event name to an empty or null string"); } UnityAnalyticsHandler unityAnalyticsHandler = GetUnityAnalyticsHandler(); if (unityAnalyticsHandler == null) { return(AnalyticsResult.NotInitialized); } return(unityAnalyticsHandler.SendCustomEventName(customEventName)); }
public static AnalyticsResult SetUserGender(Gender gender) { UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler(); AnalyticsResult result; if (unityAnalyticsHandler == null) { result = AnalyticsResult.NotInitialized; } else { result = unityAnalyticsHandler.SetUserGender(gender); } return(result); }
public static AnalyticsResult SetUserBirthYear(int birthYear) { UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler(); AnalyticsResult result; if (Analytics.s_UnityAnalyticsHandler == null) { result = AnalyticsResult.NotInitialized; } else { result = unityAnalyticsHandler.SetUserBirthYear(birthYear); } return(result); }
public static AnalyticsResult Transaction(string productId, decimal amount, string currency, string receiptPurchaseData, string signature, bool usingIAPService) { UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler(); AnalyticsResult result; if (unityAnalyticsHandler == null) { result = AnalyticsResult.NotInitialized; } else { result = unityAnalyticsHandler.Transaction(productId, Convert.ToDouble(amount), currency, receiptPurchaseData, signature, usingIAPService); } return(result); }
public static AnalyticsResult FlushEvents() { UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler(); AnalyticsResult result; if (unityAnalyticsHandler == null) { result = AnalyticsResult.NotInitialized; } else { result = unityAnalyticsHandler.FlushEvents(); } return(result); }
public static AnalyticsResult SendEvent(string eventName, object parameters, int ver = 1, string prefix = "") { if (string.IsNullOrEmpty(eventName)) { throw new ArgumentException("Cannot set event name to an empty or null string"); } if (parameters == null) { throw new ArgumentException("Cannot set parameters to null"); } UnityAnalyticsHandler unityAnalyticsHandler = GetUnityAnalyticsHandler(); if (unityAnalyticsHandler == null) { return(AnalyticsResult.NotInitialized); } return(unityAnalyticsHandler.SendEvent(eventName, parameters, ver, prefix)); }
public static AnalyticsResult CustomEvent(string customEventName) { if (string.IsNullOrEmpty(customEventName)) { throw new ArgumentException("Cannot set custom event name to an empty or null string"); } UnityAnalyticsHandler unityAnalyticsHandler = Analytics.GetUnityAnalyticsHandler(); AnalyticsResult result; if (unityAnalyticsHandler == null) { result = AnalyticsResult.NotInitialized; } else { result = unityAnalyticsHandler.CustomEvent(customEventName); } return(result); }
public static AnalyticsResult CustomEvent(string customEventName, Vector3 position) { if (string.IsNullOrEmpty(customEventName)) { throw new ArgumentException("Cannot set custom event name to an empty or null string"); } UnityAnalyticsHandler unityAnalyticsHandler = GetUnityAnalyticsHandler(); if (unityAnalyticsHandler == null) { return(AnalyticsResult.NotInitialized); } CustomEventData customEventData = new CustomEventData(customEventName); customEventData.Add("x", (double)Convert.ToDecimal(position.x)); customEventData.Add("y", (double)Convert.ToDecimal(position.y)); customEventData.Add("z", (double)Convert.ToDecimal(position.z)); return(unityAnalyticsHandler.CustomEvent(customEventData)); }
public static AnalyticsResult CustomEvent(string customEventName, IDictionary <string, object> eventData) { if (string.IsNullOrEmpty(customEventName)) { throw new ArgumentException("Cannot set custom event name to an empty or null string"); } UnityAnalyticsHandler unityAnalyticsHandler = GetUnityAnalyticsHandler(); if (unityAnalyticsHandler == null) { return(AnalyticsResult.NotInitialized); } if (eventData == null) { return(unityAnalyticsHandler.SendCustomEventName(customEventName)); } CustomEventData customEvent = new CustomEventData(customEventName); customEvent.AddDictionary(eventData); return(unityAnalyticsHandler.SendCustomEvent(customEvent)); }
internal static extern IntPtr Internal_Create(UnityAnalyticsHandler u);
internal static UnityAnalyticsHandler GetUnityAnalyticsHandler() { if (s_UnityAnalyticsHandler == null) { s_UnityAnalyticsHandler = new UnityAnalyticsHandler(); } return s_UnityAnalyticsHandler; }