private void Init(RequestRepository requestRepo, ViewEventRepository viewEventRepo,
                          NonViewEventRepository nonViewEventRepo, Dao <ConfigEntity> configDao, EventNumberInSameSessionHelper eventNumberInSameSessionHelper)
        {
            var countlyUtils = new CountlyUtils(this);
            var requests     = new RequestCountlyHelper(Config, countlyUtils, requestRepo);

            Events             = new EventCountlyService(Config, requests, viewEventRepo, nonViewEventRepo, eventNumberInSameSessionHelper);
            OptionalParameters = new OptionalParametersCountlyService();
            Notifications      = new NotificationsCallbackService(Config);
            var notificationsService = new ProxyNotificationsService(Config, InternalStartCoroutine, Events);

            _push   = new PushCountlyService(Events, requests, notificationsService, Notifications);
            Session = new SessionCountlyService(Config, _push, requests, OptionalParameters, eventNumberInSameSessionHelper);

            Consents     = new ConsentCountlyService();
            CrashReports = new CrashReportsCountlyService(Config, requests);

            Device         = new DeviceIdCountlyService(Session, requests, Events, countlyUtils);
            Initialization = new InitializationCountlyService(Session);

            RemoteConfigs = new RemoteConfigCountlyService(Config, requests, countlyUtils, configDao);

            StarRating     = new StarRatingCountlyService(Events);
            UserDetails    = new UserDetailsCountlyService(requests, countlyUtils);
            Views          = new ViewCountlyService(Config, Events);
            _inputObserver = InputObserverResolver.Resolve();
        }
        /// <summary>
        ///     Initialize SDK at the start of your app
        /// </summary>
        private async void Awake()
        {
            DontDestroyOnLoad(gameObject);
            Instance = this;

            _db = CountlyBoxDbHelper.BuildDatabase(DbNumber);

            var auto              = _db.Open();
            var configDao         = new Dao <ConfigEntity>(auto, EntityType.Configs.ToString());
            var requestDao        = new Dao <RequestEntity>(auto, EntityType.Requests.ToString());
            var viewEventDao      = new Dao <EventEntity>(auto, EntityType.ViewEvents.ToString());
            var viewSegmentDao    = new SegmentDao(auto, EntityType.ViewEventSegments.ToString());
            var nonViewEventDao   = new Dao <EventEntity>(auto, EntityType.NonViewEvents.ToString());
            var nonViewSegmentDao = new SegmentDao(auto, EntityType.NonViewEventSegments.ToString());

            var requestRepo             = new RequestRepository(requestDao, Config);
            var eventViewRepo           = new ViewEventRepository(viewEventDao, viewSegmentDao, Config);
            var eventNonViewRepo        = new NonViewEventRepository(nonViewEventDao, nonViewSegmentDao, Config);
            var eventNrInSameSessionDao = new EventNumberInSameSessionDao(auto, EntityType.EventNumberInSameSessions.ToString());

            requestRepo.Initialize();
            eventViewRepo.Initialize();
            eventNonViewRepo.Initialize();

            var eventNumberInSameSessionHelper = new EventNumberInSameSessionHelper(eventNrInSameSessionDao);

            Init(requestRepo, eventViewRepo, eventNonViewRepo, configDao, eventNumberInSameSessionHelper);


            Initialization.Begin(Auth.ServerUrl, Auth.AppKey);
            Device.InitDeviceId(Auth.DeviceId);

            await Initialization.SetDefaults(Config);
        }
Beispiel #3
0
 internal EventCountlyService(CountlyConfigModel countlyConfigModel, RequestCountlyHelper requestCountlyHelper,
                              ViewEventRepository viewEventRepo, NonViewEventRepository nonViewEventRepo, EventNumberInSameSessionHelper eventNumberInSameSessionHelper)
 {
     _countlyConfigModel             = countlyConfigModel;
     _requestCountlyHelper           = requestCountlyHelper;
     _viewEventRepo                  = viewEventRepo;
     _nonViewEventRepo               = nonViewEventRepo;
     _eventNumberInSameSessionHelper = eventNumberInSameSessionHelper;
 }