///<summary>
        ///Defines the method to be called when the command is invoked.
        ///</summary>
        ///<param name="parameter">Data used by the command.  If the command does not require data to be passed, this object can be set to null.</param>
        public void Execute(object parameter)
        {
            if (executeMethod == null)
            {
                return;
            }

            executeMethod(parameter);

            if (AnalyticsServices.IsEnabled)
            {
                var action = new CommandEvent()
                {
                    Name = this.DisplayText,
                    Data = parameter
                };

                if (this.onBeforeTracking != null)
                {
                    this.onBeforeTracking(action);
                }

                AnalyticsServices.TrackUserActionAsync(action);
            }
        }
Esempio n. 2
0
        public void SendEvent(string name, IDictionary <string, object> data, AnalyticsServices services)
        {
            if (services == AnalyticsServices.ParseDotCom || services == AnalyticsServices.Both)
            {
                var specificData = data.ToDictionary(o => o.Key, o => o.Value.ToString());

                ParseAnalytics.TrackEventAsync(name, specificData);
            }
            if (services == AnalyticsServices.UnityAnalytics || services == AnalyticsServices.Both)
            {
                UnityAnalytics.CustomEvent(name, data);
            }
        }
 public static void SendCustomEvent(this IAnalyticsEventProvider aep, AnalyticsServices services)
 {
     Analytics.Instance.SendEvent(aep, services);
 }
Esempio n. 4
0
 public void SendEvent(IAnalyticsEventProvider provider, AnalyticsServices services)
 {
     SendEvent(provider.GetAnalyticsEventName(), provider.GetAnalyticsEventData(), services);
 }