Ejemplo n.º 1
0
        public void BuildNativeConfig()
        {
            this.nativeConfig           = new AdjustConfig(this.appToken, this.environment);
            this.nativeConfig.SdkPrefix = this.sdkPrefix;

            if (this.defaultTracker != null)
            {
                this.nativeConfig.DefaultTracker = this.defaultTracker;
            }

            if (this.isEventBufferingEnabled != null)
            {
                this.nativeConfig.EventBufferingEnabled = (bool)this.isEventBufferingEnabled;
            }

            if (this.rtAttributionCallback != null)
            {
                this.nativeConfig.AttributionChanged = this.rtAttributionCallback;
            }

            if (this.rtFileReadCallback != null)
            {
                this.nativeConfig.FileReader = this.rtFileReadCallback;
            }

            if (this.rtFileWriteCallback != null)
            {
                this.nativeConfig.FileWriter = this.rtFileWriteCallback;
            }
        }
Ejemplo n.º 2
0
    public static void Start()
    {
        AdjustConfig config = new AdjustConfig(ADJUST_APP_TOKEN, AdjustEnvironment.Production);

        config.setLogLevel(AdjustLogLevel.Info);
        Adjust.start(config);
    }
Ejemplo n.º 3
0
        private static string BuildAuthorizationHeader(IReadOnlyDictionary <string, string> parameters,
                                                       string appSecret, string secretId, string activityKind)
        {
            // check if the secret exists and it's not empty
            if (string.IsNullOrEmpty(appSecret) || parameters == null)
            {
                return(null);
            }

            var signatureDetails = GetSignature(parameters, activityKind, appSecret);

            string algorithm = ALG_SHA256;
            string signature = AdjustConfig.String2Sha256Func(signatureDetails[CLEAR_SIGNATURE]);

            signature = signature.ToLower();
            string fields = signatureDetails[FIELDS];

            string secretIdHeader  = $"{SECRET_ID}=\"{secretId}\"";
            string signatureHeader = $"{SIGNATURE}=\"{signature}\"";
            string algorithmHeader = $"{ALGORITHM}=\"{algorithm}\"";
            string fieldsHeader    = $"{HEADERS}=\"{fields}\"";

            string authorizationHeader = $"Signature {secretIdHeader},{signatureHeader},{algorithmHeader},{fieldsHeader}";

            Logger.Verbose($"authorizationHeader: {authorizationHeader}");

            return(authorizationHeader);
        }
Ejemplo n.º 4
0
 internal PackageBuilder(AdjustConfig adjustConfig, DeviceInfo deviceInfo,
     DateTime createdAt)
 {
     AdjustConfig = adjustConfig;
     DeviceInfo = deviceInfo;
     CreatedAt = createdAt;
 }
Ejemplo n.º 5
0
 public void start(AdjustConfig adjustConfig)
 {
     if (this.adjust != null)
     {
         global::Debug.Log("adjust: Error, SDK already started.");
         return;
     }
     if (adjustConfig == null)
     {
         global::Debug.Log("adjust: Missing config to start.");
         return;
     }
     this.adjust = new AdjustAndroid();
     if (this.adjust == null)
     {
         global::Debug.Log("adjust: SDK can only be used in Android, iOS, Windows Phone 8 or Windows Store apps.");
         return;
     }
     this.eventSuccessDelegate       = adjustConfig.getEventSuccessDelegate();
     this.eventFailureDelegate       = adjustConfig.getEventFailureDelegate();
     this.sessionSuccessDelegate     = adjustConfig.getSessionSuccessDelegate();
     this.sessionFailureDelegate     = adjustConfig.getSessionFailureDelegate();
     this.deferredDeeplinkDelegate   = adjustConfig.getDeferredDeeplinkDelegate();
     this.attributionChangedDelegate = adjustConfig.getAttributionChangedDelegate();
     this.adjust.start(adjustConfig);
 }
Ejemplo n.º 6
0
 internal PackageBuilder(AdjustConfig adjustConfig, DeviceInfo deviceInfo,
                         DateTime createdAt)
 {
     AdjustConfig = adjustConfig;
     DeviceInfo   = deviceInfo;
     CreatedAt    = createdAt;
 }
Ejemplo n.º 7
0
        public static void ApplicationLaunching(string appToken, string environment, string logLevelString, string defaultTracker, bool?eventBufferingEnabled, string sdkPrefix, Action <Dictionary <string, string> > attributionChangedDic, Action <String> logDelegate)
        {
            LogLevel logLevel;

            if (Enum.TryParse(logLevelString, out logLevel))
            {
                Adjust.SetupLogging(logDelegate: logDelegate,
                                    logLevel: logLevel);
            }
            else
            {
                Adjust.SetupLogging(logDelegate: logDelegate);
            }

            var config = new AdjustConfig(appToken, environment);

            config.DefaultTracker = defaultTracker;

            if (eventBufferingEnabled.HasValue)
            {
                config.EventBufferingEnabled = eventBufferingEnabled.Value;
            }

            config.SdkPrefix = sdkPrefix;

            if (attributionChangedDic != null)
            {
                config.AttributionChanged = (attribution) => attributionChangedDic(attribution.ToDictionary());
            }

            Adjust.ApplicationLaunching(config);
        }
Ejemplo n.º 8
0
    protected override bool AdapterInit(SDKAdapterConfig adapterConfig)
    {
        AdjustAdapterConfig config = (AdjustAdapterConfig)adapterConfig;

        AdjustConfig adjustConfig = new AdjustConfig(config.m_AppToken, config.m_AdjustEnvironment);

        adjustConfig.setLogLevel(config.m_AdjustLogLevel);
        adjustConfig.setLogDelegate(msg => Log.I(msg));
        adjustConfig.setEventBufferingEnabled(config.m_EventBuffering);
        adjustConfig.setSendInBackground(config.m_SendInBackground);

        // adjustConfig.setDeferredDeeplinkDelegate(DeferredDeeplinkCallback);  //深度链接
        // adjustConfig.setEventSuccessDelegate(EventSuccessCallback);
        // adjustConfig.setEventFailureDelegate(EventFailureCallback);
        // adjustConfig.setSessionSuccessDelegate(SessionSuccessCallback);
        // adjustConfig.setSessionFailureDelegate(SessionFailureCallback);
        // adjustConfig.setAttributionChangedDelegate(AttributionChangedCallback);
        Adjust.start(adjustConfig);
        InitSuccess = true;

        m_AdjustDefine = new AdjustDefine();
        m_AdjustDefine.Init();

        Log.I("AdjustAnalysisAdapter init success");
        return(true);
    }
Ejemplo n.º 9
0
 public void StartAdjust()
 {
     if (this.adjust != null)
     {
         return;
     }
     if (!this.startManually)
     {
         AdjustConfig adjustConfig = new AdjustConfig(this.appToken, this.environment, this.logLevel == AdjustLogLevel.Suppress);
         adjustConfig.setLogLevel(this.logLevel);
         adjustConfig.setSendInBackground(this.sendInBackground);
         adjustConfig.setEventBufferingEnabled(this.eventBuffering);
         adjustConfig.setLaunchDeferredDeeplink(this.launchDeferredDeeplink);
         if (this.printAttribution)
         {
             adjustConfig.setEventSuccessDelegate(new Action <AdjustEventSuccess>(this.EventSuccessCallback), "Adjust");
             adjustConfig.setEventFailureDelegate(new Action <AdjustEventFailure>(this.EventFailureCallback), "Adjust");
             adjustConfig.setSessionSuccessDelegate(new Action <AdjustSessionSuccess>(this.SessionSuccessCallback), "Adjust");
             adjustConfig.setSessionFailureDelegate(new Action <AdjustSessionFailure>(this.SessionFailureCallback), "Adjust");
             adjustConfig.setDeferredDeeplinkDelegate(new Action <string>(this.DeferredDeeplinkCallback), "Adjust");
             adjustConfig.setAttributionChangedDelegate(new Action <AdjustAttribution>(this.AttributionChangedCallback), "Adjust");
         }
         this.start(adjustConfig);
         this.getGoogleAdId(delegate(string googleAdId)
         {
             global::Debug.Log("googleAdId:" + googleAdId);
         });
         string adid = this.getAdid();
         if (adid != null)
         {
             global::Debug.Log("adid:" + adid);
         }
     }
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {
            // setup logging
            Adjust.SetupLogging(logDelegate: msg => System.Diagnostics.Debug.WriteLine(msg),
                                logLevel: LogLevel.Verbose);

            // configure Adjust
            var config = new AdjustConfig("{yourAppToken}", AdjustConfig.EnvironmentSandbox);

            // enable event buffering
            //config.EventBufferingEnabled = true;

            // set default tracker
            //config.DefaultTracker = "{YourDefaultTracker}";

            // set attribution delegate
            config.AttributionChanged = (attribution) =>
                                        System.Diagnostics.Debug.WriteLine("attribution: " + attribution);

            Adjust.ApplicationLaunching(config);

            // put the SDK in offline mode
            //Adjust.SetOfflineMode(offlineMode: true);

            // disable the SDK
            //Adjust.SetEnabled(enabled: false);

            // Global handler for uncaught exceptions.
            UnhandledException += Application_UnhandledException;

            // Standard XAML initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            // Language display initialization
            InitializeLanguage();

            // Show graphics profiling information while debugging.
            if (Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode,
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Prevent the screen from turning off while under the debugger by disabling
                // the application's idle detection.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }
        }
Ejemplo n.º 11
0
 internal PackageBuilder(AdjustConfig adjustConfig, DeviceInfo deviceInfo,
                         ActivityState activityState, DateTime createdAt)
 {
     _config            = adjustConfig;
     _deviceInfo        = deviceInfo;
     _activityStateCopy = new ActivityStateCopy(activityState);
     _createdAt         = createdAt;
 }
Ejemplo n.º 12
0
        public static IActivityHandler GetActivityHandler(AdjustConfig adjustConfig, DeviceUtil deviceUtil)
        {
            if (IActivityHandler == null)
                return ActivityHandler.GetInstance(adjustConfig, deviceUtil);

            IActivityHandler.Init(adjustConfig, deviceUtil);
            return IActivityHandler;
        }
        private void Initialize()
        {
            AdjustEnvironment environment = AdjustEnvironment.Production;
            AdjustConfig      config      = new AdjustConfig(HCConstants.ADJUST_APP_TOKEN, environment, false);

            config.setLogLevel(AdjustLogLevel.Debug);
            Adjust.start(config);
        }
Ejemplo n.º 14
0
    public void OnStart()
    {
        MyLog.I("MyAdManager OnStart");
        // Adjust
        AdjustConfig adjustConfig = new AdjustConfig(MyConfig.ADJUST_TOKEN, AdjustEnvironment.Sandbox);

        adjustConfig.setLogLevel(AdjustLogLevel.Verbose);
        Adjust.start(adjustConfig);
    }
Ejemplo n.º 15
0
        public void ApplicationLaunching(AdjustConfig adjustConfig, DeviceUtil deviceUtil)
        {
            if (ActivityHandler != null)
            {
                Logger.Error("Adjust already initialized");
                return;
            }

            ActivityHandler = AdjustSdk.Pcl.ActivityHandler.GetInstance(adjustConfig, deviceUtil);
        }
Ejemplo n.º 16
0
        private ActivityHandler(AdjustConfig adjustConfig, DeviceUtil deviceUtil)
        {
            // default values
            Enabled = true;

            Logger = AdjustFactory.Logger;

            InternalQueue = new ActionQueue("adjust.ActivityQueue");
            InternalQueue.Enqueue(() => InitInternal(adjustConfig, deviceUtil));
        }
Ejemplo n.º 17
0
        private ActivityHandler(AdjustConfig adjustConfig, DeviceUtil deviceUtil)
        {
            // default values
            Enabled = true;

            Logger = AdjustFactory.Logger;

            InternalQueue = new ActionQueue("adjust.ActivityQueue");
            InternalQueue.Enqueue(() => InitInternal(adjustConfig, deviceUtil));
        }
Ejemplo n.º 18
0
        public static IActivityHandler GetActivityHandler(AdjustConfig adjustConfig, DeviceUtil deviceUtil)
        {
            if (IActivityHandler == null)
            {
                return(ActivityHandler.GetInstance(adjustConfig, deviceUtil));
            }

            IActivityHandler.Init(adjustConfig, deviceUtil);
            return(IActivityHandler);
        }
Ejemplo n.º 19
0
        public void ApplicationLaunching(AdjustConfig adjustConfig, DeviceUtil deviceUtil)
        {
            if (ActivityHandler != null)
            {
                Logger.Error("Adjust already initialized");
                return;
            }

            ActivityHandler = AdjustSdk.Pcl.ActivityHandler.GetInstance(adjustConfig, deviceUtil);
        }
Ejemplo n.º 20
0
    private void Awake()
    {
        Instance = this;
#if UNITY_EDITOR
        AdjustConfig adjustConfig = new AdjustConfig(APP_TOKEN, AdjustEnvironment.Sandbox);
#else
        AdjustConfig adjustConfig = new AdjustConfig(APP_TOKEN, AdjustEnvironment.Production);
#endif
        adjustConfig.sendInBackground = true;
        adjustConfig.setAttributionChangedDelegate(OnAttributionChangedCallback);
        Adjust.start(adjustConfig);
    }
Ejemplo n.º 21
0
        public void ApplicationLaunching(AdjustConfig adjustConfig, IDeviceUtil deviceUtil)
        {
            adjustConfig.PreLaunchActions = _preLaunchActions;
            adjustConfig.StartEnabled     = _startEnabled;
            adjustConfig.StartOffline     = _startOffline;

            AdjustConfig.String2Sha256Func = deviceUtil.HashStringUsingSha256;
            AdjustConfig.String2Sha512Func = deviceUtil.HashStringUsingSha512;
            AdjustConfig.String2Md5Func    = deviceUtil.HashStringUsingShaMd5;

            _activityHandler = ActivityHandler.GetInstance(adjustConfig, deviceUtil);
        }
 public override void Init()
 {
     if (this.ycManager.ycConfig.MmpAdjustAppToken != "")
     {
         AdjustConfig config = new AdjustConfig(this.ycManager.ycConfig.MmpAdjustAppToken, AdjustEnvironment.Production, true);
         config.setLogLevel(AdjustLogLevel.Suppress);
         Adjust.start(config);
     }
     else
     {
         Debug.LogWarning("[ADJUST] you active adjust but you forget the AppToken");
     }
 }
Ejemplo n.º 23
0
 internal PackageBuilder(AdjustConfig adjustConfig,
                         DeviceInfo deviceInfo,
                         ActivityState activityState,
                         SessionParameters sessionParameters,
                         DateTime createdAt)
     : this(adjustConfig, deviceInfo, activityState, createdAt)
 {
     // no need to copy because all access is made synchronously
     //  in Activity Handler inside internal functions.
     //  only exceptions are ´Enable´ and ´AskingAttribution´
     //  and they are not read here
     //_ActivityState = activityState;
     _sessionParameters = sessionParameters;
 }
Ejemplo n.º 24
0
        private void ExampleOfVariousCallbacksSetup(AdjustConfig config)
        {
            // set event success tracking delegate
            config.EventTrackingSucceeded = adjustEventSuccess =>
            {
                // ...
                //Debug.WriteLine("adjustEventSuccess: " + adjustEventSuccess);
            };

            // set event failure tracking delegate
            config.EventTrackingFailed = adjustEventFailure =>
            {
                // ...
                //Debug.WriteLine("adjustEventFailure: " + adjustEventFailure);
            };

            // set session success tracking delegate
            config.SesssionTrackingSucceeded = adjustSessionSuccess =>
            {
                // ...
                //Debug.WriteLine("adjustSessionSuccess: " + adjustSessionSuccess);
            };

            // set session failure tracking delegate
            config.SesssionTrackingFailed = adjustSessionFailure =>
            {
                // ...
                //Debug.WriteLine("adjustSessionFailure: " + adjustSessionFailure);
            };

            // set attribution delegate
            config.AttributionChanged = attribution =>
            {
                // ...
                Debug.WriteLine("attribution: " + attribution);
            };

            // deferred deep linking scenario
            config.DeeplinkResponse = deepLinkUri =>
            {
                //Debug.WriteLine("deeplink response: " + deepLinkUri);

                if (ShouldAdjustSdkLaunchTheDeeplink(deepLinkUri))
                {
                    return(true);
                }

                return(false);
            };
        }
Ejemplo n.º 25
0
    private void Awake()
    {
        Instance = this;
#if UNITY_EDITOR
        AdjustConfig adjustConfig = new AdjustConfig(APP_TOKEN, AdjustEnvironment.Sandbox);
#else
        AdjustConfig adjustConfig = new AdjustConfig(APP_TOKEN, AdjustEnvironment.Production);
#endif
        adjustConfig.sendInBackground       = true;
        adjustConfig.launchDeferredDeeplink = true;
        adjustConfig.eventBufferingEnabled  = true;
        adjustConfig.logLevel = AdjustLogLevel.Info;
        adjustConfig.setAttributionChangedDelegate(OnAttributionChangedCallback);
        Adjust.start(adjustConfig);
    }
Ejemplo n.º 26
0
        public static ActivityHandler GetInstance(AdjustConfig adjustConfig, DeviceUtil deviceUtil)
        {
            if (adjustConfig == null)
            {
                AdjustFactory.Logger.Error("AdjustConfig missing");
                return(null);
            }

            if (!adjustConfig.IsValid())
            {
                AdjustFactory.Logger.Error("AdjustConfig not initialized correctly");
                return(null);
            }

            ActivityHandler activityHandler = new ActivityHandler(adjustConfig, deviceUtil);

            return(activityHandler);
        }
Ejemplo n.º 27
0
        public static ActivityHandler GetActivityHandler(MockLogger mocklogger, DeviceUtil deviceUtil)
        {
            MockAttributionHandler mockAttributionHandler = new MockAttributionHandler(mocklogger);
            MockPackageHandler     mockPackageHandler     = new MockPackageHandler(mocklogger);

            AdjustFactory.SetAttributionHandler(mockAttributionHandler);
            AdjustFactory.SetPackageHandler(mockPackageHandler);

            // create the config to start the session
            AdjustConfig config = new AdjustConfig(appToken: "123456789012", environment: AdjustConfig.EnvironmentSandbox);

            // start activity handler with config
            ActivityHandler activityHandler = ActivityHandler.GetInstance(config, deviceUtil);

            deviceUtil.Sleep(3000);

            return(activityHandler);
        }
Ejemplo n.º 28
0
        private void InitInternal(AdjustConfig adjustConfig, DeviceUtil deviceUtil)
        {
            Init(adjustConfig, deviceUtil);
            DeviceInfo           = DeviceUtil.GetDeviceInfo();
            DeviceInfo.SdkPrefix = adjustConfig.SdkPrefix;

            TimerInterval      = AdjustFactory.GetTimerInterval();
            TimerStart         = AdjustFactory.GetTimerStart();
            SessionInterval    = AdjustFactory.GetSessionInterval();
            SubsessionInterval = AdjustFactory.GetSubsessionInterval();

            if (AdjustConfig.Environment.Equals(AdjustConfig.EnvironmentProduction))
            {
                // suppress all logs in production
                Logger.LogLevel = LogLevel.Suppress;
            }

            if (AdjustConfig.EventBufferingEnabled)
            {
                Logger.Info("Event buffering is enabled");
            }

            if (AdjustConfig.DefaultTracker != null)
            {
                Logger.Info("Default tracker: '{0}'", AdjustConfig.DefaultTracker);
            }

            ReadAttribution();
            ReadActivityState();

            PackageHandler = AdjustFactory.GetPackageHandler(this, Paused());

            var attributionPackage = GetAttributionPackage();

            AttributionHandler = AdjustFactory.GetAttributionHandler(this,
                                                                     attributionPackage,
                                                                     Paused(),
                                                                     AdjustConfig.HasDelegate);

            Timer = new TimerCycle(InternalQueue, TimerFiredInternal, timeInterval: TimerInterval, timeStart: TimerStart);

            StartInternal();
        }
Ejemplo n.º 29
0
        private void Start()
        {
            string adjustAppToken = Constants.ADJUST_TOKEN_IOS;

            if (Application.platform == RuntimePlatform.Android)
            {
                adjustAppToken = Constants.ADJUST_TOKEN_ANDROID;
            }
            else if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                adjustAppToken = Constants.ADJUST_TOKEN_IOS;
            }

            AdjustEnvironment environment = AdjustEnvironment.Production;

            if (Debug.isDebugBuild)
            {
                environment = AdjustEnvironment.Sandbox;
            }
            else
            {
                environment = AdjustEnvironment.Production;
            }


            AdjustConfig config = new AdjustConfig(adjustAppToken, environment, true);

            config.setDeferredDeeplinkDelegate(DeferredDeeplinkCallback);

            if (Debug.isDebugBuild)
            {
                config.setLogLevel(AdjustLogLevel.Verbose);
            }
            else
            {
                config.setLogLevel(AdjustLogLevel.Info);
            }
            config.setSendInBackground(true);
            new GameObject("Adjust").AddComponent <Adjust>();
            config.setAttributionChangedDelegate(this.attributionChangedDelegate);
            Adjust.start(config);
        }
Ejemplo n.º 30
0
        public void SetConfig(string json)
        {
            Debug.Log($"---- AdjustHelper SetConfig // Json {json}");

            if (!string.IsNullOrEmpty(json) && !json.Equals("{}"))
            {
                _adjustData = JsonUtility.FromJson <AdjustData>(json);

                if (string.IsNullOrEmpty(_adjustData.token))
                {
                    Debug.Log("!!!!!!!!!!!!!!!! Error: Adjust Token is Empty ");
                    return;
                }
                else
                {
                    Debug.Log($"AdjustHelper Init // Token {_adjustData.token}");
                }

                var config = new AdjustConfig(_adjustData.token, AdjustEnvironment.Production, false);
                config.setLogLevel(AdjustLogLevel.Verbose);
                config.setSendInBackground(true);
                config.setAttributionChangedDelegate(AttributionChangedCallback);

                config.setDefaultTracker(_adjustData.token);
                config.setAllowIdfaReading(true);
                config.setPreinstallTrackingEnabled(true);
                config.setAllowiAdInfoReading(true);
                config.setAllowAdServicesInfoReading(true);

                config.setEventBufferingEnabled(true);
                //config.setProcessName();

                Adjust.setEnabled(true);
                Adjust.start(config);

                Debug.Log($"Adjust started");
            }
            else
            {
                Debug.Log($"!!!!!!!!!!!!!!!! AdjustHelper isn`t inited");
            }
        }
Ejemplo n.º 31
0
    private void InitAdjust(string adjustAppToken)
    {
        var adjustConfig = new AdjustConfig(
            adjustAppToken,
            AdjustEnvironment.Production, // AdjustEnvironment.Sandbox to test in dashboard
            true
            );

        adjustConfig.setLogLevel(AdjustLogLevel.Info);    // AdjustLogLevel.Suppress to disable logs
        adjustConfig.setSendInBackground(true);
        new GameObject("Adjust").AddComponent <Adjust>(); // do not remove or rename

// Adjust.addSessionCallbackParameter("foo", "bar"); // if requested to set session-level parameters

//adjustConfig.setAttributionChangedDelegate((adjustAttribution) => {
// Debug.LogFormat("Adjust Attribution Callback: ", adjustAttribution.trackerName);
//});

        Adjust.start(adjustConfig);
    }
Ejemplo n.º 32
0
        public void Init(string token)
        {
            if (string.IsNullOrEmpty(token))
            {
                AdId = "organic";
                return;
            }
#if UNITY_ANDROID && !UNITY_EDITOR
            AdjustConfig config = new AdjustConfig(token, AdjustEnvironment.Production, false);
            config.setLogLevel(AdjustLogLevel.Verbose);
            config.setLogDelegate(msg => Debug.Log(msg));

            //config.setAttributionChangedDelegate(AttributionChangedCallback);

            Adjust.start(config);
#else
            Debug.Log("ADID IS ORGANIC");
            AdId = "organic";
#endif
        }
Ejemplo n.º 33
0
    private void InitAdjust(string token)
    {
        if (UnityEngine.Object.FindObjectOfType(typeof(Adjust)) == null)
        {
            GameObject ga = new GameObject();
            ga.name = "Adjust";
            //ga.transform.parent = transform;
            ga.AddComponent <Adjust>();
        }
        else
        {
            Debug.LogWarning("A GameAnalytics object already exists in this scene - you should never have more than one per scene!");
        }

        AdjustConfig config = new AdjustConfig(token, AdjustEnvironment.Production, true);

        config.setLogLevel(AdjustLogLevel.Suppress);
        config.setLogDelegate(msg => Debug.Log(msg));
        Adjust.start(config);
    }
Ejemplo n.º 34
0
        private void InitInternal(AdjustConfig adjustConfig, DeviceUtil deviceUtil)
        {
            Init(adjustConfig, deviceUtil);
            DeviceInfo = DeviceUtil.GetDeviceInfo();
            DeviceInfo.SdkPrefix = adjustConfig.SdkPrefix;

            TimerInterval = AdjustFactory.GetTimerInterval();
            TimerStart = AdjustFactory.GetTimerStart();
            SessionInterval = AdjustFactory.GetSessionInterval();
            SubsessionInterval = AdjustFactory.GetSubsessionInterval();

            if (AdjustConfig.Environment.Equals(AdjustConfig.EnvironmentProduction))
            {
                Logger.LogLevel = LogLevel.Assert;
            }

            if (AdjustConfig.EventBufferingEnabled)
            {
                Logger.Info("Event buffering is enabled");
            }

            if (AdjustConfig.DefaultTracker != null)
            {
                Logger.Info("Default tracker: '{0}'", AdjustConfig.DefaultTracker);
            }

            ReadAttribution();
            ReadActivityState();

            PackageHandler = AdjustFactory.GetPackageHandler(this, Paused());

            var attributionPackage = GetAttributionPackage();

            AttributionHandler = AdjustFactory.GetAttributionHandler(this,
                attributionPackage,
                Paused(),
                AdjustConfig.HasDelegate);

            Timer = new TimerCycle(InternalQueue, TimerFiredInternal, timeInterval: TimerInterval, timeStart: TimerStart);

            StartInternal();
        }
Ejemplo n.º 35
0
 public void Init(AdjustConfig adjustConfig, DeviceUtil deviceUtil)
 {
     MockLogger.Test("{0} Init", prefix);
 }
Ejemplo n.º 36
0
 internal PackageBuilder(AdjustConfig adjustConfig, DeviceInfo deviceInfo, ActivityState activityState, DateTime createdAt)
     : this(adjustConfig, deviceInfo, createdAt)
 {
     ActivityState = activityState.Clone();
 }
Ejemplo n.º 37
0
        public static ActivityHandler GetInstance(AdjustConfig adjustConfig, DeviceUtil deviceUtil)
        {
            if (adjustConfig == null)
            {
                AdjustFactory.Logger.Error("AdjustConfig missing");
                return null;
            }

            if (!adjustConfig.IsValid())
            {
                AdjustFactory.Logger.Error("AdjustConfig not initialized correctly");
                return null;
            }

            ActivityHandler activityHandler = new ActivityHandler(adjustConfig, deviceUtil);
            return activityHandler;
        }
Ejemplo n.º 38
0
 public void Init(AdjustConfig adjustConfig, DeviceUtil deviceUtil)
 {
     AdjustConfig = adjustConfig;
     DeviceUtil = deviceUtil;
 }