Exemplo n.º 1
0
        protected void BeginSession()
        {
            Log("Start session");
            if (canReceivePush)
            {
                gcm.Init(GCMProjectNumber);
            }

            StringBuilder builder = InitConnectionDataStringBuilder();

            // compute metrics
            _deviceInfo.JSONSerializeMetrics(builder);
            string metricsString = builder.ToString();

            builder = InitConnectionData(_deviceInfo);

            builder.Append("&sdk_version=");
            AppendConnectionData(builder, SDK_VERSION);

            builder.Append("&begin_session=1");

            builder.Append("&metrics=");
            AppendConnectionData(builder, metricsString);

            ConnectionQueue.Enqueue(builder.ToString());
            ProcessConnectionQueue();
        }
Exemplo n.º 2
0
        public virtual void Attribute(string campaign_id)
        {
            StringBuilder builder = new StringBuilder(1024);

            builder.Append("at/" + campaign_id);
            Log(builder.ToString());
            ConnectionQueue.Enqueue(builder.ToString());
            ProcessConnectionQueue(true);
        }
Exemplo n.º 3
0
        public void UpdateProfile()
        {
            StringBuilder builder = InitConnectionData(_deviceInfo);

            builder.Append("&user_details=");
            AppendConnectionData(builder, userProfile.JSONSerializeProfile().ToString());

            ConnectionQueue.Enqueue(builder.ToString());
            ProcessConnectionQueue();
        }
Exemplo n.º 4
0
        protected void UpdateSession(long duration)
        {
            DeviceInfo    info    = GetDeviceInfo();
            StringBuilder builder = InitConnectionData(info);

            builder.Append("&session_duration=");
            AppendConnectionData(builder, duration.ToString());

            ConnectionQueue.Enqueue(builder.ToString());
            ProcessConnectionQueue();
        }
Exemplo n.º 5
0
        protected void RecordEvents(List <Event> events)
        {
            StringBuilder builder = InitConnectionData(_deviceInfo);

            builder.Append("&events=");
            string eventsString = JSONSerializeEvents(events);

            AppendConnectionData(builder, eventsString);

            ConnectionQueue.Enqueue(builder.ToString());
        }
Exemplo n.º 6
0
        public void SendReportWithoutCoroutineCall(int id)
        {
            if (CrashReporter.reports == null || CrashReporter.reports.Count == 0)
            {
                Log("No crash reports found");
                return;
            }

            StringBuilder builder = InitConnectionData(_deviceInfo);

            builder.Append("&crash=");
            string report = CrashReporter.JSONSerializeReport(CrashReporter.reports[id]).ToString();

            AppendConnectionData(builder, report);

            ConnectionQueue.Enqueue(builder.ToString());
        }
Exemplo n.º 7
0
        protected void BeginSession()
        {
            DeviceInfo    info    = GetDeviceInfo();
            StringBuilder builder = InitConnectionDataStringBuilder();

            // compute metrics
            info.JSONSerializeMetrics(builder);
            string metricsString = builder.ToString();

            builder = InitConnectionData(info);

            builder.Append("&sdk_version=");
            AppendConnectionData(builder, SDK_VERSION);

            builder.Append("&begin_session=1");

            builder.Append("&metrics=");
            AppendConnectionData(builder, metricsString);

            ConnectionQueue.Enqueue(builder.ToString());
            ProcessConnectionQueue();
        }