Esempio n. 1
0
        public void MissionStarted(int id, string name, string type, Dictionary <string, object> additionalParams)
        {
            IDictionary <string, object> extras = new Dictionary <string, object>();

            extras ["missionID"]   = id;
            extras ["missionName"] = name;
            extras ["missionType"] = type;

            AndroidJavaObject sjo = GetUnityJavaObject();

            if (null != sjo)
            {
                sjo.Call("addExtras", new object[] { PsdkUtils.CreateJavaJSONObjectFromDictionary(extras) });
            }
            else
            {
                Debug.LogWarning("Not calling android psdk analytics MissionStarted ! cause object is null");
            }

            if (additionalParams != null)
            {
                foreach (var item in additionalParams)
                {
                    extras.Add(item.Key, item.Value);
                }
            }

            LogEvent(AnalyticsTargets.ANALYTICS_TARGET_DELTA_DNA, "missionStarted", extras, false, true);
        }
Esempio n. 2
0
        public void LevelUp(string skinName, string levelUpName, int level, Dictionary <string, object> additionalParams)
        {
            IDictionary <string, object> extras = new Dictionary <string, object>();

            extras ["userLevel"] = level;

            IDictionary <string, object> eventParams = new Dictionary <string, object>();

            eventParams ["levelUpName"] = levelUpName;
            eventParams ["skinName"]    = skinName;

            if (additionalParams != null)
            {
                foreach (var item in additionalParams)
                {
                    eventParams.Add(item.Key, item.Value);
                }
            }

            AndroidJavaObject sjo = GetUnityJavaObject();

            if (null != sjo)
            {
                sjo.Call("addExtras", new object[] { PsdkUtils.CreateJavaJSONObjectFromDictionary(extras) });
            }
            else
            {
                Debug.LogWarning("Not calling android psdk analytics LevelUp ! cause object is null");
            }

            LogEvent(AnalyticsTargets.ANALYTICS_TARGET_DELTA_DNA, "levelUp", eventParams, false, true);
        }
Esempio n. 3
0
        public void LogEvent(string eventName, IDictionary <string, object> eventParams)
        {
            AndroidJavaObject sjo = GetUnityJavaObject();

            if (null != sjo)
            {
                sjo.Call("logEvent", eventName, PsdkUtils.CreateJavaJSONObjectFromDictionary(eventParams));
            }
            else
            {
                Debug.Log("Event was not sent: " + eventName + " -> " + Json.Serialize(eventParams));
            }
        }
Esempio n. 4
0
        public void EndLogEvent(string eventName, IDictionary <string, object> eventParams)
        {
            AndroidJavaObject sjo = GetUnityJavaObject();

            if (null != sjo)
            {
                sjo.Call("endLogEvent", eventName, PsdkUtils.CreateJavaJSONObjectFromDictionary(eventParams));
            }
            else
            {
                Debug.LogWarning("Not calling android psdk analytics LogComplexEvent !, cause object is null");
                Debug.Log("EndLogEvent public void ReportPurchase(string price, string currency, string productId) {was not sent: " + eventName + " -> " + Json.Serialize(eventParams));
            }
        }
Esempio n. 5
0
        public void LogEvent(long targets, string eventName, IDictionary <string, object> eventParams, bool timed, bool psdkEvent)
        {
            AndroidJavaObject sjo = GetUnityJavaObject();

            if (null != sjo)
            {
                sjo.Call("logEvent", targets, eventName, PsdkUtils.CreateJavaJSONObjectFromDictionary(eventParams), timed, psdkEvent);
            }
            else
            {
                Debug.LogWarning("Not calling android psdk analytics LogComplexEvent !, cause object is null");
                Debug.Log("Event was not sent: " + eventName + " -> " + Json.Serialize(eventParams));
            }
        }
Esempio n. 6
0
        public bool RequestEngagement(string decisionPoint, Dictionary <string, object> parameters)
        {
            bool retVal           = false;
            AndroidJavaObject sjo = GetUnityJavaObject();

            if (null != sjo)
            {
                retVal = sjo.Call <bool>("requestEngagement", decisionPoint, PsdkUtils.CreateJavaJSONObjectFromDictionary(parameters));
            }
            else
            {
                Debug.LogWarning("Not calling android psdk analytics RequestEngagement !, cause object is null");
            }
            return(retVal);
        }