Beispiel #1
0
    public static void SendEvent(string eventID)
    {
        GA_Submit.CategoryType category = GA_Submit.CategoryType.GA_Event;

        List <GA_Submit.Item> queue      = new List <GA_Submit.Item>();
        Hashtable             parameters = new Hashtable()
        {
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.EventID], eventID },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Level], "Unity Editor" },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.UserID], _userID },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.SessionID], _sessionID },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Build], GA_Settings.VERSION }
        };

        queue.Add(new GA_Submit.Item()
        {
            AddTime = 0, Count = 1, Type = category, Parameters = parameters
        });
        Dictionary <GA_Submit.CategoryType, List <GA_Submit.Item> > dict = new Dictionary <GA_Submit.CategoryType, List <GA_Submit.Item> >();

        dict.Add(category, queue);

        WWW www = GetEventWWW(category, parameters);

        GA_ContinuationManager.StartCoroutine(GA_Submit.SendWWW(www, Submitted, SubmitError, true, "", "", queue), () => www.isDone);
    }
Beispiel #2
0
    public static void SendUserEvent()
    {
        GA_Submit.CategoryType category = GA_Submit.CategoryType.GA_User;

        string os = "";

        string[] osSplit = SystemInfo.operatingSystem.Split(' ');
        if (osSplit.Length > 0)
        {
            os = osSplit[0];
        }

                #if UNITY_IPHONE
        bool idfa = CheckIDFA();
                #endif

        List <GA_Submit.Item> queue      = new List <GA_Submit.Item>();
        Hashtable             parameters = new Hashtable()
        {
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Platform], GA_GenericInfo.GetSystem() },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Device], SystemInfo.deviceModel },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Os], os },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.OsVersion], SystemInfo.operatingSystem },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Sdk], "GA Unity SDK " + GA_Settings.VERSION },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.InstallPublisher], "UnityVersion:" + UnityEditorInternal.InternalEditorUtility.GetFullUnityVersion() },
                        #if UNITY_IPHONE
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.InstallSite], "IDFA:" + idfa.ToString() },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.InstallCampaign], "iAD:" + EditorPrefs.GetBool("GA_IAD" + "-" + Application.dataPath, GA_Settings.IAD_DEFAULT) },
                        #endif
                        #if UNITY_IPHONE || UNITY_ANDROID
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.InstallAdgroup], "Chartboost:" + EditorPrefs.GetBool("GA_CB" + "-" + Application.dataPath, GA_Settings.CB_DEFAULT) },
                        #endif
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.UserID], _userID },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.SessionID], _sessionID },
            { GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Build], GA_Settings.VERSION }
        };
        queue.Add(new GA_Submit.Item()
        {
            AddTime = 0, Count = 1, Type = category, Parameters = parameters
        });
        Dictionary <GA_Submit.CategoryType, List <GA_Submit.Item> > dict = new Dictionary <GA_Submit.CategoryType, List <GA_Submit.Item> >();
        dict.Add(category, queue);

        WWW www = GetEventWWW(category, parameters);
        GA_ContinuationManager.StartCoroutine(GA_Submit.SendWWW(www, Submitted, SubmitError, true, "", "", queue), () => www.isDone);
    }