internal DDNAImpl(DDNA ddna) : base(ddna)
        {
            string eventStorePath = null;

            if (Settings.UseEventStore)
            {
                eventStorePath = Settings.EVENT_STORAGE_PATH.Replace("{persistent_path}", Application.persistentDataPath);
                if (!Utils.IsDirectoryWritable(eventStorePath))
                {
                    Logger.LogWarning("Event store path unwritable, event caching disabled.");
                    Settings.UseEventStore = false;
                }
            }

            eventStore = new EventStore(eventStorePath);
            if (Settings.UseEventStore && !eventStore.IsInitialised)
            {
                // failed to access files for some reason
                Logger.LogWarning("Failed to access event store path, event caching disabled.");
                Settings.UseEventStore = false;
                eventStore             = new EventStore(eventStorePath);
            }

            #if DDNA_SMARTADS
            // initialise SmartAds so it can register for events
            var smartAds = SmartAds.Instance;
            smartAds.transform.parent = gameObject.transform;

            EngageFactory = new EngageFactory(this, smartAds);
            #else
            EngageFactory = new EngageFactory(this, null);
            #endif
        }
Exemple #2
0
        internal DDNAImpl(DDNA ddna) : base(ddna)
        {
            string eventStorePath = null;

            if (Settings.UseEventStore)
            {
                eventStorePath = Settings.EVENT_STORAGE_PATH
                                 .Replace("{persistent_path}", Application.persistentDataPath);
                if (!Utils.IsDirectoryWritable(eventStorePath))
                {
                    Logger.LogWarning("Event store path unwritable, event caching disabled.");
                    Settings.UseEventStore = false;
                }
            }

            eventStore = new EventStore(eventStorePath);
            if (Settings.UseEventStore && !eventStore.IsInitialised)
            {
                // failed to access files for some reason
                Logger.LogWarning("Failed to access event store path, event caching disabled.");
                Settings.UseEventStore = false;
                eventStore             = new EventStore(eventStorePath);
            }
            engageCache = new EngageCache(Settings);
            actionStore = new ActionStore(Settings.ACTIONS_STORAGE_PATH
                                          .Replace("{persistent_path}", Application.persistentDataPath));
            ImageMessageStore     = new ImageMessageStore(ddna);
            executionCountManager = new ExecutionCountManager();

            EngageFactory = new EngageFactory(this);
        }
Exemple #3
0
        internal DDNAImpl(DDNA ddna) : base(ddna)
        {
            string eventStorePath = null;

            if (Settings.UseEventStore)
            {
                eventStorePath = Settings.EVENT_STORAGE_PATH
                                 .Replace("{persistent_path}", Application.persistentDataPath);
                if (!Utils.IsDirectoryWritable(eventStorePath))
                {
                    Logger.LogWarning("Event store path unwritable, event caching disabled.");
                    Settings.UseEventStore = false;
                }
            }

            eventStore = new EventStore(eventStorePath);
            if (Settings.UseEventStore && !eventStore.IsInitialised)
            {
                // failed to access files for some reason
                Logger.LogWarning("Failed to access event store path, event caching disabled.");
                Settings.UseEventStore = false;
                eventStore             = new EventStore(eventStorePath);
            }
            engageCache = new EngageCache(Settings);
            actionStore = new ActionStore(Settings.ACTIONS_STORAGE_PATH
                                          .Replace("{persistent_path}", Application.persistentDataPath));
            ImageMessageStore     = new ImageMessageStore(ddna);
            executionCountManager = new ExecutionCountManager();

            #if DDNA_SMARTADS
            // initialise SmartAds so it can register for events
            var smartAds = SmartAds.Instance.Config(engageCache);
            smartAds.transform.parent = gameObject.transform;

            EngageFactory = new EngageFactory(this, smartAds);

            Application.RequestAdvertisingIdentifierAsync(
                (string advertisingId, bool trackingEnabled, string error) => {
                if (trackingEnabled)
                {
                    PlayerPrefs.SetString(DDNA.PF_KEY_ADVERTISING_ID, advertisingId);
                }
            }
                );
            #else
            EngageFactory = new EngageFactory(this, null);
            #endif
        }
Exemple #4
0
 internal DDNANonTracking(DDNA ddna) : base(ddna)
 {
     EngageFactory = new EngageFactory(this, null);
 }