Example #1
0
        protected IEnumerator RunTimer()
        {
            while (true)
            {
                yield return(new WaitForSeconds(updateInterval / 4)); //it's better to do 4 small tasks than one big task

                if (_isSuspended == true)
                {
                    continue;
                }

                // device info may have changed
                UpdateDeviceInfo();
                yield return(new WaitForSeconds(updateInterval / 4));

                //check and send any pending crash reports
                if (!manualReports && CrashReporter.fetchReports())
                {
                    CountlyManager.SendReports();
                }
                yield return(new WaitForSeconds(updateInterval / 4));

                // record any pending events
                FlushEvents(0);
                yield return(new WaitForSeconds(updateInterval / 4));

                long duration = TrackSessionLength();
                UpdateSession(duration);
            }
        }
Example #2
0
        protected void Start()
        {
            logQ = new Queue(128, 128, false);

            Log("Start Countly Manager instance");

            CrashReporter.Init();

            _isReady = true;
            Init(appKey);
        }
Example #3
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());
        }